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..............
[Thursday, February 21, 2008
|
2
comments
]
Popular Posts
- MySQL stored procedure&triggers
- php questions
- Php Questions
- How we canmove into last changed position on info window close event On google map
- Pattern Matching in mysql
- MySQL INDEX
- MYSQL joins
- Jquery based dynamic adding and removal of html elements.
- securing a form with captcha
- Comparing a date with current date
2 comments
question 4:
array_unshift()
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.