Makeing the alt tag work..<

liunx

Guest
But you see, it's more than making the alt tag work. Ok, in that script scoutt wrote, I noticed there was no alt tag. So, I thought, that's easy enough, I can do that on my own. I open up the file the ***tion is in and I change it to this: $content = "<img src=http://www.htmlforums.com/archive/index.php/\"{$level[0]}.jpg\" alt=\"\"><br>";

but the output is, alt=""" ...that's too many quotes, but I only have 2 quotes, so I don't know where the 3rd is coming from.

Hope this is in the right forums.i don't see where that third one came up..

but try

$content = "<img src=http://www.htmlforums.com/archive/index.php/\"{$level[0]}.jpg\" alt=\"image\"><br>";

or

$content = '<img src=http://www.htmlforums.com/archive/index.php/"'.$level[0].'.jpg" alt="image"><br>';

to see if it make any differenceI'll try that in just a sec, but you reminded me of another question I have but forgot about before.

In the second one where you have it like this: $content = '<img src=http://www.htmlforums.com/archive/index.php/"'.$level[0].'.jpg" alt="image"><br>';

Why don't you have to escape the "?

And, that fixed it, but I wish I knew where the extra quote came from.if your string delimiter is ", all those " inside need to be escape to tell php which one is the ending one.

same thing with the '

so if you start with ' and have " inside, you don't need to escpe them... same way if your start with " and have ' inside!


" " will be parsed and variable inside will be replace by their value

' ' will be output as it is!


<?php
$test = 'asdf';
echo 'this is a $test';
// output: this is a $test
echo "this is a $test";
// output: this is a asdf
?>sweet, I learned something new :D ...thanks :)vydana, it is all personal preference on which way you do it.

personally I don't like using ' unless I have to.jimminey crickets you caught me off gaurd calling me vydana :)hehe sorry, won't happen again :Poh, no, it's ok, I just forgot that you would have known that name, that's all. Vydana is a find to call me (it is my name after all :P) ...no worries :D ...but you can call me Vy is you want, that's what most people shorten it too :)
 
Back
Top