koolego Posted February 28, 2009 Share Posted February 28, 2009 Hi Gang, I have this Array ( [mobile_browser] => [has_pointing_device] => 1 [model_name] => 2.0 [brand_name] => generic web browser [release_date] => 1994_january [unique] => 1 ) Code $valwash = str_replace("1","Yes",$val); Result Array ( [mobile_browser] => [has_pointing_device] => YES [model_name] => 2.0 [brand_name] => generic web browser [release_date] => YES994_january [unique] => YES ) Is their easy way to fix this? Any pointers would be very help and very welcome. Thanks Link to comment https://forums.phpfreaks.com/topic/147308-solved-str_replace-for-1-but-not-for-1994/ Share on other sites More sharing options...
MadTechie Posted February 28, 2009 Share Posted February 28, 2009 try this $valwash= preg_replace('/^1$/', 'YES', $val); Link to comment https://forums.phpfreaks.com/topic/147308-solved-str_replace-for-1-but-not-for-1994/#findComment-773241 Share on other sites More sharing options...
koolego Posted February 28, 2009 Author Share Posted February 28, 2009 Brilliant thank you MadTechie Love this place!! Link to comment https://forums.phpfreaks.com/topic/147308-solved-str_replace-for-1-but-not-for-1994/#findComment-773245 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.