You are here: Re: mail function « PHP Programming Language « IT news, forums, messages
Re: mail function

Posted by Bent Stigsen on 06/12/06 12:57

maya wrote:
> Super_Lopez wrote:
[snip]
>> [2] http://www.php.net/manual/en/language.types.string.php
>>
>> Regards.
>
> muchas gracias Super Lopez! :)
>
> I understand now how this works..
>
> echo "$x<br>";
>
> since you don't escape '$' php knows it's a variable (how does it know
> when var name ends though.. since here there's no space between end of
> var name and the rest..) will certainly look at urls you suggest..
> again muchas gracias....

It's a good observation. I guess you have seen how to resolve it from the
link above, but I just wanted to add that it (ambiguities) is in general
something, that one should be watchful of, and verify how it is
interpretated.

To quote from a comment on another language; "The programmer is always
assumed to know what he is doing and is not hemmed in by petty
restrictions."

That is quite true for PHP, but unfortunately PHP's interpretation is not
allways intuitive.

Take for instance:

$a = 'hello_world';
$hello_world['en'] = "Hello World\n";
$hello_world['es'] = "Hola mundo\n";
$hello_world['dk'] = "Hej verden\n";

//This will give you the array of strings, $hello_world
print_r($$a);

//but, this will not give you $hello_world['en']
echo $$a['en'];

//however, this will
echo ${$a}['en'];


There was a thread a couple of weeks ago called "Butt ugly", with perhaps a
more common "mistake", one might make.
http://groups.google.com/group/comp.lang.php/browse_frm/thread/18ee03b0075b57d2


/Bent

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация