3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = 'Advisor Geologist – HighMount Exploration & Production LLC – Oklahoma City, OK'; $arr = explode( '–', $str); var_dump( $arr, end( $arr)); $last = trim( end( $arr)); echo $last;
Output for 4.3.0 - 7.1.0
array(3) { [0]=> string(18) "Advisor Geologist " [1]=> string(40) " HighMount Exploration & Production LLC " [2]=> string(18) " Oklahoma City, OK" } string(18) " Oklahoma City, OK" Oklahoma City, OK