[ create a new paste ] login | about

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

PHP, pasted on Jun 3:
1
2
3
4
5
6
7
<?php

$return = '{foo}bar{/foo}';
$regex = "#([{].*?[}])(.*?)([{]/.*?[}])#e";
$return = preg_replace($regex,"('$2')",$return);

echo $return;


Output:
1
bar


Create a new paste based on this one


Comments: