kingot
01-10-2012, 11:12 AM
Hi,
Please i'm writing a program using a regular expression .
Now , i created a string called 'this is a test' and i want to replace 'test' with 'assignment', i try this code but not working , can someone help me
Here is the code
[<?php]
$string='this is a test';
$preg_replace= preg_replace('/[a-zA-Z]/','assignment', $string);
echo $preg_replace;
[ ?>]
Thanks
Clement Osei
Please i'm writing a program using a regular expression .
Now , i created a string called 'this is a test' and i want to replace 'test' with 'assignment', i try this code but not working , can someone help me
Here is the code
[<?php]
$string='this is a test';
$preg_replace= preg_replace('/[a-zA-Z]/','assignment', $string);
echo $preg_replace;
[ ?>]
Thanks
Clement Osei