Jump to content

Search elements of an Array in text


mjahkoh

Recommended Posts

I got an Array whereby the contents are  to be searched in a string and removed(stripped) .  This leaves the text bare of the 'Subtitle'.

The text is derived in a loop so only one field will be available in a loop eg 'Address: P.O. Box 4, Mogososiek 20403'.

So we search and remove 'Address:'

 

$subtitle = array('Category :','Location:','Address:','Telephone:','City:','Region:','Description :','Website:','Email:','Postcode:','Street:','Phone:','County:');

 

$text = "Category : Western Province,

Location:

Address: P.O. Box 4, Mogososiek 20403

Telephone: 052-21051

City: Mogososiek

Region: Western

Description :

";

 

Please help

Regards,

Jackson

Link to comment
https://forums.phpfreaks.com/topic/245191-search-elements-of-an-array-in-text/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.