alanl1 Posted July 8, 2013 Share Posted July 8, 2013 Hi All I am doing a str_replace for different values that need to be replaced within my variable like so $datadownboxValue = str_replace(' ', '_', $datadownboxValue); $datadownboxValue = str_replace('-', '_', $datadownboxValue); $datadownboxValue = str_replace('/', '_', $datadownboxValue); can this be done easier EG all in one rather than repeat for each different value thanks in advance Link to comment https://forums.phpfreaks.com/topic/279951-str_replace-help/ Share on other sites More sharing options...
kicken Posted July 8, 2013 Share Posted July 8, 2013 search The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles. $datadownboxValue = str_replace(array(' ', '-', '/'), '_', $datadownboxValue); Link to comment https://forums.phpfreaks.com/topic/279951-str_replace-help/#findComment-1439856 Share on other sites More sharing options...
alanl1 Posted July 8, 2013 Author Share Posted July 8, 2013 thank you for your quick response, that has solved my problem thanks again Link to comment https://forums.phpfreaks.com/topic/279951-str_replace-help/#findComment-1439857 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.