tel me any 2 regular expressions with example
Answer / shyambabu
int ereg ( string $pattern , string $string [, array
&$regs ] )
Date Format:YYYY-MM-DD
if (ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $date,
$regs)) {
echo "$regs[3].$regs[2].$regs[1]";
prints in dd.mm.yyyy format
} else {
echo "Invalid date format: $date";
}
string ereg_replace ( string $pattern , string
$replacement , string $string )
$num = '4';
$string = "This string has four words.";
$string = ereg_replace('four', $num, $string);
echo $string; /* Output: 'This string has 4 words.'
| Is This Answer Correct ? | 2 Yes | 0 No |
Tell me what library is used for pdf in php?
Write a select query that will be displayed the duplicated site name and how many times it is duplicated?
How to send email using php script?
How do you trim spaces in excel?
What is php constructor?
Is php deprecated?
What are getters and setters and why are they important?
What is strlen function in php?
How you can update memcached when you make changes to php?
What are php magic methods?
Explain the different types of errors in php.
we store and display scores of users in different games. In MySQL, records are stored as tuples (user-id, game-id, score). Now we need to support ranks of users, i.e., each user should be informed of his current rank in the community. The challenge is to come up with the best way to store the data in MySQL so that the requirements are efficiently met.