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

Which operator is used to combine string values in php?

0 Answers  


how to track no of users logged in?

0 Answers  


How many open modes available when a file open in PHP?

0 Answers  


What is variable and data type?

0 Answers  


Where is the submitted form data stored?

0 Answers  


Why post method is used in php?

0 Answers  


What are the encryption functions in php?

0 Answers  


What is use of in_array() function in php?

0 Answers  


what is pear in php in brief ?

1 Answers  


How can I find the width and height of an image resource?

2 Answers   Rushmore Consultancy,


sort term descripttion form, report and uery

0 Answers  


How to remove leading and trailing spaces from user input values?

0 Answers  


Categories