How do I get all words starting with $ (it's not a variable)?
This is what I've got, but it doesn't return the words. Can anyone help me?
$str = 'Lorem $ipsum dolor sit $amet, consectetur adipiscing $elit. Fusce nec turpis magna, in tempor sem. Duis porttitor $feugiat ligula, in vehicula nunc pellentesque vel. Morbi consectetur pretium lorem. Vivamus nunc mauris, consequat vel condimentum vel, lobortis sit amet eros. Fusce hendrerit adipiscing justo at scelerisque. $Phasellus sed convallis $tellus. In sed lacus ac nulla bibendum scelerisque.'; preg_match("/(\$[a-z]+)/i", $str, $matches); var_dump($matches);