fork download
  1. <?php
  2. $s = "{\$success url='http://w...content-available-to-author-only...n.localhost/form-success'}
  3. {\$error url='http://w...content-available-to-author-only...n.localhost/form-error'}
  4. {\$button title='send form'}";
  5.  
  6. preg_match_all('/\{\$(?:success|error|button)\s+([^}]+)\}/i', $s, $match );
  7. print_r($match);
  8. ?>
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Array
        (
            [0] => {$success url='http://w...content-available-to-author-only...n.localhost/form-success'}
            [1] => {$error url='http://w...content-available-to-author-only...n.localhost/form-error'}
            [2] => {$button title='send form'}
        )

    [1] => Array
        (
            [0] => url='http://w...content-available-to-author-only...n.localhost/form-success'
            [1] => url='http://w...content-available-to-author-only...n.localhost/form-error'
            [2] => title='send form'
        )

)