Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

tel me any 2 regular expressions with example

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does php work?

925


What happens when submit button is clicked?

884


Tell me what is the difference between ereg_replace() and eregi_replace()?

1048


What are php data types?

924


Why is php so popular?

868


What are the different loops in php?

998


How can we pass the variable through the navigation between the pages?

919


What is the difference between Split and Explode in PHP?

993


How will you calculate days between two dates in PHP?

1017


How can we connect to a mysql database from a php script?

1039


What is php mean?

988


How can you increase the maximum execution time of a script in php?

897


What is explode() in php?

948


Which function would you use to merge two arrays in php?

921


How do I clear my browser session?

972