Tag Archives: PHP Scripts

How to replace a content using regular expression search in php?

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

How to replace a content in php?

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");
?>

Add one day additional to a date in 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

Zooming image with jquery

Check the following links to see how it work

To download it please click the below links