Woodburn2006 Posted April 23, 2009 Share Posted April 23, 2009 similar to nl2br() is there any way of going through a block of text and making it make the inverted commas visible, as i have this text taken from a DB and it has a load of question marks where there should be an inverted comma. also, is there a way to make a new line create a bullet point similar to how nl2br() creates a break? this is the page im working on: http://www.ontherocks.me.uk/index2.php?go=gear&member=ben thanks Quote Link to comment Share on other sites More sharing options...
jonsjava Posted April 23, 2009 Share Posted April 23, 2009 not sure this will work, but you can give it a go: <?php $data = str_replace("�", ",", "Gibson Les Paul Custom-87�(fitted with Zakk wilde EMG 81 and 85 pickups)"); print $data; ?> Quote Link to comment Share on other sites More sharing options...
jonsjava Posted April 23, 2009 Share Posted April 23, 2009 that didn't work out too well: <?php $data = str_replace("�", ",", "Gibson Les Paul Custom-87�(fitted with Zakk wilde EMG 81 and 85 pickups)"); print $data; Quote Link to comment Share on other sites More sharing options...
taquitosensei Posted April 23, 2009 Share Posted April 23, 2009 check your encoding. Usually when you get the checkmark with a black background or any other strange symbols it's because your encoding is wrong somewhere along the lines. Either when putting it in your database, pulling it out or displaying it. check your headers for this line or something close <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> if you don't have this line add it inside your head tags. If you do modify the charset to utf-8 if it's already utf-8 try iso8859-1 Quote Link to comment Share on other sites More sharing options...
jonsjava Posted April 23, 2009 Share Posted April 23, 2009 actually, I'm betting it's caused by someone copying and pasting from a word document. Quote Link to comment Share on other sites More sharing options...
jackpf Posted April 23, 2009 Share Posted April 23, 2009 In response to your bulleting each line, this may work: (untested) $str = 'whatever you want to have'; $str = explode("\n", $str); echo '<ul>'; foreach($str as $key => $value) { echo '<li>'.$value.'</li>'; } echo '</ul>'; Quote Link to comment 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.