[ create a new paste ] login | about

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

PHP, pasted on Nov 23:
1
2
3
4
5
6
<?php
$subject = '[FUNC1] [FUNC2] [FUNC3]';
$pattern = '/\[(.*)\]/U';
$replacement = '$1();';

echo preg_replace($pattern, $replacement, $subject);


Output:
1
FUNC1(); FUNC2(); FUNC3();


Create a new paste based on this one


Comments: