ivytony Posted February 1, 2009 Share Posted February 1, 2009 I have a title like this 'Aero GP Al Ain - Live webcast of Air race and Air Show, a video from AirSportsTV. aero gp al ain, aero gp, live webcast, webcast, live' I want to delete the part shown in bold and keep the first half. However, the first half may be different in other titles, and the second half that I want to delete always starts with ', a video from' I wonder how to do this using wild card. Link to comment https://forums.phpfreaks.com/topic/143411-solved-how-to-replace-string-with-wild-card/ Share on other sites More sharing options...
corbin Posted February 1, 2009 Share Posted February 1, 2009 $str = "Aero GP Al Ain - Live webcast of Air race and Air Show, a video from AirSportsTV. aero gp al ain, aero gp, live webcast, webcast, live"; $str = substr($str, 0, strpos($str, ", a video from")); Link to comment https://forums.phpfreaks.com/topic/143411-solved-how-to-replace-string-with-wild-card/#findComment-752239 Share on other sites More sharing options...
ivytony Posted February 1, 2009 Author Share Posted February 1, 2009 Thank you so much! It works Link to comment https://forums.phpfreaks.com/topic/143411-solved-how-to-replace-string-with-wild-card/#findComment-752242 Share on other sites More sharing options...
corbin Posted February 1, 2009 Share Posted February 1, 2009 No problem ;p. Link to comment https://forums.phpfreaks.com/topic/143411-solved-how-to-replace-string-with-wild-card/#findComment-752251 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.