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 |
what are Implode and Explode functions?
Tell us what does $_cookie means?
What is the purpose of the following files having extensions 1) .frm 2) .myd 3) .myi? What do these files contain?
Is php deprecated?
Where do we use get and post?
How to increase the execution time of a PHP script?
I am working in VFP with no knowledge of web programming.I want to learn web database programmin. Can I choose PHP and MYSQL for that?
Explain the different types of errors in php.
What is php default argument?
How can I embed a java programme in PHP file and what changes have to be done in PHP.ini file?
1 Answers Sify, Small Biz Express,
Do I need apache for php?
How does php work with apache?