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
- php questions
- some php questions
- How to create a plugin in elgg.
- php Questions
- Mysql query for searching a value, add weightage on the number of occurances and sort based on the weight-age
- Contact Me
- solving the packaging problem in PHP
- How to add or remove WWW on URLs using htaccess.
- php questions
- Inserting nodes into xml files using XML DOM in PHP .
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.