You are here: Assigning variables in if's « PHP Programming Language « IT news, forums, messages
Assigning variables in if's

Posted by jodleren on 11/28/07 09:24

Hi!

In while (false !== ($file = readdir($handle)))

what happens?
The $file gets assigned, and the value of that is compared with false?
The assignment is being compared with false

Say, I want to return true or an error code. Can I do;

if($err = somefunc())
echo "ok"
else
echo "error: $err";

WBR
Sonnich

 

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

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