Depending on how you proceed, you may find the trim, or rtrim command helpful...
http://www.php.net/trim
http://www.php.net/rtrim
Announcement
Collapse
No announcement yet.
Odd issue with HTML in MySQL and page breaks
Collapse
X
-
I have tried to str_replace \r\n or each individually, but it would appear those characters don't appear until I use the mysql_real_escape_string() function on the code. I know I NEED to run that function in order for the INSERT queries to run correctly, but I can't seem to find a way to strip those page/line breaks that exist in the code in the DB before hand. I tried this:
PHP Code:$text = preg_replace( '/\p{Z}/u', ' ', $text );
Leave a comment:
-
Viewing the first block of code in my editor, ultraedit, I see end of line characters where the break tags appear in the second block of code.
You'll need to remove those - either \r, \n or both depending on the character set.
Leave a comment:
-
Odd issue with HTML in MySQL and page breaks
I am in the process of converting a non-forum portion of my database between two CMS systems and long story short, I am having an odd problem with line breaks.
If you look at this page here: http://pcper.com/article.php?aid=651&type=expert
and view the source code you'll see a section of text that starts with "graphics card testing" that has "breaks" in the code in the source, but those breaks do NOT show up when viewing the page - which is what I want.
Looking at the DB in phpMyAdmin, this is what I see for that code:
HTML Code:<em><span style="color: rgb(0, 86, 172);">Graphics card testing has become the most hotly debated issue in the hardware enthusiast community recently. Because of that, testing graphics cards has become a much more complicated process than it once was. Before you might have been able to rely on the output of a few synthetic, automatic benchmarks to make your video card purchase, that is just no longer the case. Video cards now cost up to $500 and we want to make sure that we are giving the reader as much information as we can to aid you in your purchasing decision. We know we can't run every game or find every bug and error, but we try to do what we can to aid you, our reader, and the community as a whole.</span></em></p> <p align="left"><em><span style="color: rgb(0, 86, 172);">With that in mind, all the benchmarks that you will see in this review are from games that we bought off the shelves just like you. Of these games, there are two different styles of benchmarks that need to be described.</span></em></p> <p align="left"><em><span style="color: rgb(0, 86, 172);">The first is the "timedemo-style" of benchmark. Many of you may be familiar with this style from games like Quake III; a "demo" is recorded in the game and a set number of frames are saved in a file for playback. When playing back the demo, the game engine then renders the frames as quickly as possible, which is why you will often ...
HTML Code:<em><span style="color: rgb(0, 86, 172);">Graphics card testing has<br /> become the most hotly debated issue in the hardware enthusiast<br /> community recently. Because of that, testing graphics cards has become<br /> a much more complicated process than it once was. Before you might<br /> have been able to rely on the output of a few synthetic, automatic<br /> benchmarks to make your video card purchase, that is just no longer the<br /> case. Video cards now cost up to $500 and we want to make sure that we<br /> are giving the reader as much information as we can to aid you in your<br /> purchasing decision. We know we can't run every game or find every bug<br /> and error, but we try to do what we can to aid you, our reader, and the<br /> community as a whole.</span></em></p>
Thanks!!Tags: None
Related Topics
Collapse
-
by Wayne LukeThe Static HTML Module allows you to provide a lot of customization to your site including embedding from other sites, slideshows and even small custom games. However it does have a few caveats when being...
-
Channel: vBulletin 5 Tutorials
Thu 20 Dec '12, 10:11am -
-
by DemOnstarHello there. I am about to embark on another aspect of this massive learning curve and I need your help. I have given up on permissions for the time being because I am not getting very far there.
...-
Channel: Support Issues & Questions
Tue 18 Dec '12, 8:40pm -
Leave a comment: