Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $a = '{4}/{2}+{1}-{3}*1+100';
- echo '<pre>' .var_export($a, true) .'</pre>';
- $b = preg_replace('/(\{([0-9]+?)\})/', '\$valor$2', $a);
- echo '<pre>' .var_export($b, true) .'</pre>';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement