PDA

View Full Version : pre replace function


Vizionz
12-11-2005, 09:03 PM
alright i am trying to do a radio chart system within my vb i have it as a iframe and everything is working cept for when i call the images.

%20 i need to generate that into the echo if there is a blank space.

so http://www.site.com/picture12 4567.gif
would instead be http://www.site.com/picture12%204567.gif

i was looking at php.net and the function

To strip blank lines (blank, with tab or whitespaces) from a string:

<?php
$text=preg_replace("/[\r\n]+[\s\t]*[\r\n]+/","\n",$text);
?>

echo "<td width=\"20%\"bordercolorlight=\"#000000\"bordercolordark=\"#000000\"><center><img src=pictures/" . $songs[$i]["picture"] . " width=\"70\" height=\"70\"></center></td>";


thats the line i need to use that function

Adrian Schneider
12-11-2005, 09:25 PM
If it is just for replacing spaces..... this would work:

echo "<td width=\"20%\"bordercolorlight=\"#000000\"bordercolordark=\"#000000\"><center><img src=pictures/" . str_replace(' ', '%20', $songs[$i]["picture"]) . " width=\"70\" height=\"70\"></center></td>";

Vizionz
12-11-2005, 09:33 PM
much appreciated Sir Adrian

Vizionz
03-09-2006, 05:42 AM
<?php include("album2.php?artist=" . str_replace(' ', '%20', $song["artist"]) . "); ?>

thats gonna give me a error whats missing

anyone ?