Skip to main content

Posts

Showing posts from June, 2014

php interview questions and answers for two year experienced

php interview questions and answers for two year experienced 1Q:  What is the difference between the functions unlink and unset? Ans: unlink() deletes the given file from the file system.      unset() makes a variable undefined. 2Q:  How many ways we can pass the variable through the navigation between the pages? Ans: GET, QueryString, POST 3Q:  How can we know the count/number of elements of an array? Ans:  2 ways      a) sizeof($urarray) This function is an alias of count()      b) count($urarray) 4Q:  How can we convert the time zones using PHP? Ans: date_default_timezone_set('Asia/Tokyo'); 5Q:  How many ways can we get the value of current session id? Ans: session_id() returns the session id for the current session. 6Q:   How can we destroy the session, how can we unset the variable of       a session? Ans:  session_unregister — Unregister a global variable from the current       session       session_unset — Free all session variables.