gtal3x Posted June 16, 2009 Share Posted June 16, 2009 Hello, this is probably an easy question but I haven't used php for few years now and can not figure how to do this :'( :'(... Basically let say I have a string "Blah Blah Blah |||Need This Text Only||| Blah Blah Blah"... What is the easiest way to get the text "Need This Text Only" from the string, knowing that always infront and after the text there is going to be something like "|||"...? Link to comment https://forums.phpfreaks.com/topic/162467-extract-some-text-from-string/ Share on other sites More sharing options...
Ken2k7 Posted June 17, 2009 Share Posted June 17, 2009 Why would you have such a string? God forbid if you have that in MySQL table cell. <?php $str = 'Blah Blah Blah |||Need This Text Only||| Blah Blah Blah'; $parts = explode('|||',$str); var_dump($parts[1]); Link to comment https://forums.phpfreaks.com/topic/162467-extract-some-text-from-string/#findComment-857735 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.