I have a "location" field in my database and I would like to output only a portion of that field (the part before a "-".
I have a "location" field in my database and I would like to output only a portion of that field. The format is "City","State" - "other information" I would like to only output the portion of the field to the left of the "-" (only city and state not the other information. )
Here is the code I am currently using...
<a href="https://www.priceline.com/stay/#/search/hotels/<?php echo($row_WADAallshows2['location']); ?>/<?php echo(($row_WADAallshows2['showbegin'] && date('Ymd',strtotime($row_WADAallshows2['showbegin'])) != "11/30/-0001")?date('Ymd',strtotime($row_WADAallshows2['showbegin'])):''); ?>/<?php echo(($row_WADAallshows2['showend'] && date('Ymd',strtotime($row_WADAallshows2['showend'])) != "11/30/-0001")?date('Ymd',strtotime($row_WADAallshows2['showend'])):''); ?>/1?searchType=CITY&page=1" target="_blank"><strong>(Hotels)</strong></a>
"I only want to output the City & State to Priceline"