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



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

Post New Answer

More PHP Interview Questions

Why do we use session?

0 Answers  


When you want to show some part of a text displayed on an html page in red font color? What different possibilities are there to do this? What are the advantages/disadvantages of these methods?

0 Answers  


What are different ways to redirect from on page to other?

9 Answers  


What is difference between base_url and site_url?

0 Answers  


Is php better than java?

0 Answers  


Which function is used in php to search a particular value in an array?

0 Answers  


How can we destroy the cookie?

4 Answers  


List the different types of print functions available in php?

0 Answers  


Is php 5 still supported?

0 Answers  


Which php global variable is used for uploading a file?

0 Answers  


How to uploaded files to a table?

0 Answers  


Which MySQL function would you use to select a database?

0 Answers  


Categories