PHP Interview Questions Part III

some more interview questions here..

34. What is the difference between the functions unlink and unset

Ans: unlink deletes a file, and unset unset a given variable.


35. How can we register the variables into a session

Ans: session_register("name", "value");


36. How can we get the properties (size, type, width, height) of an image using php image functions

Ans: getimagesize -- Get the size of an image

37. How can we get the browser properties using php

Ans: get_browser -- Tells what the user's browser is capable of

38. What is the maximum size of a file that can be uploaded using php and how can we change this

Ans: upload_max_filesize="size"

39. How can we increase the execution time of a php script

Ans: set_time_limit -- Limits the maximum execution time

40. How can a take a backup of a mysql table and how can we restore it.

Ans: Backup databasename

41. How can we optimize or increase the speed of a mysql select query

Ans: By indexing columns

42. How many ways can we get the value of current session id?

Ans: by a variable PHPSESSID

43. How can we destroy the session, how can we unset the variable of a session

Ans: session_destroy() to unset a variable session_regirster("name"
,"new value")

44. How can we destroy the cookie

Ans: by seeting its time to a old time

45. How many ways we can pass the variable through the navigation between the pages

Ans: cookies, sessions, hidden variables

46. What is the difference between ereg_replace() and eregi_replace()

Ans: case insensitive

47. What are the different functions in sorting an array
Ans: sort, ksort, asort, usort

48. How can we know the count/number of elements of an array

49. What is the php predefined variable that tells the what types of images that php supports
Ans: count()