View Full Version : Take source from webpage, and make it one line

05-05-2006, 05:38 PM
Hey I ran into a problem, with a tooltip script I found on the internet.

What I want, is a tooltip, which content is an entire other site. I got it to work, but when I try to catch the source from the specific site, it doesnt work.

What I got is:

Text[0] = [<?php print($item); ?>]

This $item is equal to more then one line of text, with line breaks. I need to make the content in $item only one line, så that [ and ] are on the same line!

How do I do that? :rolleyes:

05-05-2006, 05:57 PM
that's an issue with your PHP output, not your javascript. Should ask in a PHP forum, but try doing a strreplace("\n", ""); or something. php.net is your friend.

05-05-2006, 06:24 PM
Okay, thanks.

I'll ask in the PHP forum too, but it isn't just a str_replace, cause I got no character to replace.

05-05-2006, 06:33 PM
new line is a character

05-05-2006, 06:40 PM
Wow, thanks... All I needed was a little push towards the right thing.

It works a-okay now! ;)