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 |
Which operator is used to combine string values in php?
how to track no of users logged in?
How many open modes available when a file open in PHP?
What is variable and data type?
Where is the submitted form data stored?
Why post method is used in php?
What are the encryption functions in php?
What is use of in_array() function in php?
what is pear in php in brief ?
How can I find the width and height of an image resource?
2 Answers Rushmore Consultancy,
sort term descripttion form, report and uery
How to remove leading and trailing spaces from user input values?