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 Quote 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); Quote 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!! Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.