hassank1 Posted April 3, 2008 Share Posted April 3, 2008 hii am working on something like a forum.. so when user posts something like : " hiiii helloooo testing .. " the result become after posting.. " hiii helloooo testing " so spaces aren't shown at the beginning !! Quote Link to comment https://forums.phpfreaks.com/topic/99438-solved-insert-spaces-into-posts/ Share on other sites More sharing options...
discomatt Posted April 3, 2008 Share Posted April 3, 2008 This is html, not PHP... Convert spaces to ' ' or enclose in <pre></pre> tags. $subject = str_replace(' ', ' ', $subject); Quote Link to comment https://forums.phpfreaks.com/topic/99438-solved-insert-spaces-into-posts/#findComment-508805 Share on other sites More sharing options...
wildteen88 Posted April 3, 2008 Share Posted April 3, 2008 Web browsers ignore any whitespace you'll need to force the browser to display such whitespace as discomatt suggests. Quote Link to comment https://forums.phpfreaks.com/topic/99438-solved-insert-spaces-into-posts/#findComment-508808 Share on other sites More sharing options...
hassank1 Posted April 3, 2008 Author Share Posted April 3, 2008 how can I when using pre to make a background color .. like in code displaying? Quote Link to comment https://forums.phpfreaks.com/topic/99438-solved-insert-spaces-into-posts/#findComment-508822 Share on other sites More sharing options...
wildteen88 Posted April 4, 2008 Share Posted April 4, 2008 You'd use CSS to apply to styles on your webpage, eg: pre { background-color: #e1e1e1; } That will apply a light grey background colour to all pre tags. Quote Link to comment https://forums.phpfreaks.com/topic/99438-solved-insert-spaces-into-posts/#findComment-509346 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.