fork download
  1. <?php
  2. $subject = 'Hello World, this is a Test. $i = 1, $sString = "Test"';
  3. preg_match_all('/[$]\w+/', $subject, $matches);
  4. print_r($matches);
  5. ?>
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Array
        (
            [0] => $i
            [1] => $sString
        )

)