fork download
  1. <?php
  2. $array = array();
  3. $input = 'this is a #test';
  4. $regex = '/(#\w*)/';
  5. $regex,
  6. '$match', 'global $array;
  7. $array[] = $match[1]; return "<strong>" . $match[1] . "</strong>";'),
  8. $input);
  9. echo "Result string:\n", $output, "\n\n";
  10. echo "Result array:\n";
  11. print_r($array);
  12. ?>
Success #stdin #stdout 0.02s 13112KB
stdin
Standard input is empty
stdout
Result string:
this is a <strong>#test</strong>

Result array:
Array
(
    [0] => #test
)