fork download
  1. <?php
  2.  
  3. $string = 'Great @jason I think @sally would love it too.';
  4. preg_match_all("/@\w+/", $string, $matches);
  5.  
  6. var_dump($matches);
  7.  
  8. ?>
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
array(1) {
  [0]=>
  array(2) {
    [0]=>
    string(6) "@jason"
    [1]=>
    string(6) "@sally"
  }
}