PHP Interview Question and Answer for Experience

PHP : 2+ Years Experience of Interview Question and Answer


25.) How can we destroy the session, how can we unset the variable of a session?

session_destroy
session_unset

26.) How can we destroy the cookie?

Set same the cookie in past

27.) What is the difference between ereg_replace() and eregi_replace()?

eregi_replace() function is identical to ereg_replace() except that this ignores case distinction when matching alphabetic characters.eregi_replace() function is identical to ereg_replace() except that this ignores case distinction when matching alphabetic characters.

28.) How can we know the count/number of elements of an array?

Two ways
a) sizeof($urarray) This function is an alias of count()
b) count($urarray)
interestingly if u just pass a simple var instead of a an array it will return 1.

29.) What is the maximum length of a table name, database name, and fieldname in mysql?

Database name- 64
Table name -64 Fieldname-64

30.) How many values can the SET function of mysql takes?

Mysql set can take zero or more values but at the maximum it can take 64 values.


1 2 3 4 5 6 7 8