| 2 comments ]

1 Consider the following String:

$string = "John\tMark\nTed\tLarry";

2 Which of the following functions would best parse the string above by the tab (\t) and newline (\n) characters?

3 How can you modify the copy of an object during a clone operation?

Answer...
Put the logic in the object's constructor to alter the values
Implment your own function to do object copying
Implement the object's __clone() method
Implement __get() and __set() methods with the correct logic
Implement the __copy() method with the correct logic

4 Which function would you use to add an element to the beginning of an array?

Answer...
array_shift()
array_push();
$array[0] = "value";
array_unshift()
array_pop();

ans: array_unshift();

Please answer through the comments I will make it publish on blog..............

2 comments

nkhanchandani said... @ Sunday, April 27, 2008 at 4:31:00 PM GMT+1

question 4:
array_unshift()

sAm said... @ Tuesday, February 2, 2010 at 12:57:00 PM GMT

Answer for question 1 = strtok($string, "\t\n");

to verify, check:
http://www.php.net/strtok

Post a Comment

Please put your comments here. your questions, your suggestions, also what went wrong with me.