Reply to Re: Question about variable declaration

Your name:

Reply:


Posted by Andy Hassall on 05/21/05 17:54

On 21 May 2005 07:42:39 -0700, "macduder83" <adrian.pavelescu@gmail.com> wrote:

>I have modified my PHP.ini file so that it reports E_ALL, even the
>notices. I wanted to see everything. Question is how do I declare a
>variable... bare with me, Im new to PHP.

Variables aren't declared in PHP, at least not separately from initialisation.

Assign a value to the variable before you attempt to read any values from it.

<?php
print $x; // produces a warning
?>

<?php
$x = 1;
print $x; // no warning
?>

--
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool

[Back to original 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

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