Miko Posted April 24, 2009 Share Posted April 24, 2009 Hello, I was wondering if the following is possible: one of my scripts get's data from the mysql database and in one of the collumns has email addresses. Now that collumn can contain several addresses al seperated with an ";" . It should stay with the ";" in the database but must be show in html with an non breaking space ( ). I was just trying to "fix" this with an array like this: $dot_comma = array(";" => " "); but then he doesn't show anything. Someone has an idea? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/155509-solved-if-variable-contains/ Share on other sites More sharing options...
jackpf Posted April 24, 2009 Share Posted April 24, 2009 So you just want to replace ; with ; ? If so, you can do this: $str = str_replace(';', '; ', $str); Quote Link to comment https://forums.phpfreaks.com/topic/155509-solved-if-variable-contains/#findComment-818273 Share on other sites More sharing options...
jonsjava Posted April 24, 2009 Share Posted April 24, 2009 <?php //sql goes here //assuming you outputted it to an array, we'll call that array "row" $email = $row['email']; $email = str_replace(";", " ", $email); Quote Link to comment https://forums.phpfreaks.com/topic/155509-solved-if-variable-contains/#findComment-818276 Share on other sites More sharing options...
Miko Posted April 24, 2009 Author Share Posted April 24, 2009 thanks, it worked Quote Link to comment https://forums.phpfreaks.com/topic/155509-solved-if-variable-contains/#findComment-818277 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.