It’s as follows :-
<?php
$string = 'April 15, 2003';
$pattern = '/(\w+) (\d+), (\d+)/i';
$replacement = '${1}1,$3';
echo preg_replace($pattern, $replacement, $string);
?>
O/p :-
April1,2003
It’s as follows :-
<?php
$string = 'April 15, 2003';
$pattern = '/(\w+) (\d+), (\d+)/i';
$replacement = '${1}1,$3';
echo preg_replace($pattern, $replacement, $string);
?>
April1,2003
It’s as folllows : –
<?php
$vowels = array("a", "e", "i", "o", "u", "A", "E", "I", "O", "U");
$onlyconsonants = str_replace($vowels, "", "Hello World of PHP");
?>
It’s as follows : –
$year=2013; $month=04; $date=12; $newdate=date('Y-m-d H:i:s', strtotime($
year
."-".$month
."-".$date
." 00:00:00" . ' + 1 day'));
O/p :-
$new date will be “2013-04-13 00:00:00“
Check the following links to see how it work
To download it please click the below links
You must be logged in to post a comment.