Hướng dẫn php image size

\n"; for ($col=1; $col<=4; $col++) { $f=$f+1; $getfile = $files[$f]; echo "

Asked 4 years, 3 months ago

Viewed 616 times

I try to put image size in image src tag, but it still does not work. The image can be displayed fine.

";

for ($row=1; $row <= 4; $row++) { 
    echo "
"; echo "

Bhumi ShahBhumi Shah

8,9617 gold badges58 silver badges96 bronze badges

3

Not the answer you're looking for? Browse other questions tagged php or ask your own question.

I am echoing an image which works fine, but then i want to set how big it needs to be, and I just can't seem to get the syntax right.

This is what I have:

echo " ';

answered Apr 22, 2014 at 15:46

theHackertheHacker

3,9341 gold badge18 silver badges30 bronze badges

try changing double quotes into single quotes for these attributes

height='130' width='150'

since double quotes are actually delimiting the PHP string. Optionally you may instead escape the double quotes like so

height=\"130\" width=\"150\"

but this syntax is less readable and more error prone (not recommended)

answered Apr 22, 2014 at 15:45

Fabrizio CalderanFabrizio Calderan

117k25 gold badges164 silver badges168 bronze badges

ok its here

echo '';

answered Apr 22, 2014 at 15:45

4

You can uses variables inside double quotes, like this:

Pedro LobitoPedro Lobito

88.2k29 gold badges238 silver badges256 bronze badges

Sometimes the way that you're using causes to errors if you don't do it properly.Therefore you can try this way also.


if you're using this inside a loop,you can do like this.




Hope this helped to you.

answered Apr 22, 2014 at 15:52

CodeCanyonCodeCanyon

9191 gold badge11 silver badges35 bronze badges

Not the answer you're looking for? Browse other questions tagged php html syntax or ask your own question.