Re: Cannot get this one correct and working, though simple!



Message-ID: <1135959418.255476.21750@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> from
comp.lang.php contained the following:

>The problem lies in the way you embedded $i. PHP thinks you have a
>variable literally called "$i.jpg" since a period is a valid implied
>variable name character.

It is? News to me.
>
>Try this instead:
>
><img src='thumb${i}.jpg'>
>
>curly braces will separate out the valid variable name characters.

No, what he's got works, his problem is elsewhere.

See:-

<?php

$i=1;

print"<img src='thumbs$i.jpg'>";

//outputs <img src='thumbs1.jpg'>
?>

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
.



Relevant Pages

  • PHP and Java
    ... I am not so sure where the problem lies with this. ... a small java program and it compiles and runs without any issues. ... I want to get the PHP intgration with java working, ...
    (php.general)
  • sending mail from debian etch via php script using mail()
    ... after calling the mailmethod or function in php all seems well as ... So I am trying to figure out where the problem lies on my debian etch box. ... how do I chech to see if it is install or configure? ...
    (Debian-User)
  • Re: HAPPY NEW YEAR
    ... allow creation of different procedures with the same name in different ... It's not a problem for most people or most languages. ... Dare I suggest that the problem lies with php? ...
    (comp.os.vms)
  • Re: Cannot get this one correct and working, though simple!
    ... Oli Filth wrote: ... >> The problem lies in the way you embedded $i. PHP thinks you have a ... The PHP manual. ... > The problem is the use of single quotes rather than double quotes. ...
    (comp.lang.php)
  • Re: [PHP] CSV Files
    ... After I right out the column headers do I have to put a '/n' to have it start a new line in the CSV file? ... refer to a newline character. ... rather than chrin PHP, ... character at the end of every row in CSV including the header row. ...
    (php.general)