[ create a new paste ] login | about

Link: http://codepad.org/aVA8x876    [ raw code | output | fork ]

PHP, pasted on Jun 18:
1
2
3
4
5
6
7
<?php
$str = "hi,this is a test";
$test = "string test";
echo preg_replace("(,\w*)","$test",$str);
echo "\n\n";
$str = "hi,this is a test";
echo preg_replace("(,\w*)","$1",$str);


Output:
1
2
3
histring test is a test

hi is a test


Create a new paste based on this one


Comments: