Microsoft
Software
Hardware
Network
Question : php str_replace question
The output of the array ['location'] is always state, city and zip:
<?=niceLabel(str_replace('
,', ', ', $listing['location']), false)?>
So the output of the code above is:
North Jackson, OH 44451
What I would like to do is to remove City and State so the only output will be the Zip Code only:
44451
Answer : php str_replace question
Assuming that the zipcode is always 5 numbers long, and preceeded by a space, this works:
$string="Anywhere, OH 12345";
$zip = substr($string,strrpos($st
ring," ")+1,5);
echo $zip;
Random Solutions
128GB USB Flash drives
Domain Controller rename and IP change
Setting up wireless on a Cisco 1811
Asterisk 1.4 assigning outbound routes based on extension
Auto file move and rename
Microsoft Information Store stalling issues
Issue with Thecus 1u4500 not booting
return double array in Delphi call to c++
Group Policy Interval for computer - update a specific time
Access 2007, form datasheet view, change display property of an element based on another element in the record