[ create a new paste ] login | about

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

PHP, pasted on Sep 21:
1
2
3
4
5
<?php

$string = 'blah blah |one|';
$search = array('/\\|(one)\\|/','/\\|(two)\\|/');
echo preg_replace($search,'<img src="$1.png"/>',$string);


Output:
1
blah blah <img src="one.png"/>


Create a new paste based on this one


Comments: