Re: Cannot get this one correct and working, though simple!
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

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

From: Geoff Berrow <blthecat@ckdog.co.uk>
Date: Fri Dec 30 2005 - 17:37:06 CET

Message-ID: <1135959418.255476.21750@g14g2000cwa.googlegroups.com> 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/
Received on Tue Jan 3 03:50:35 2006