You are here: RE: [PHP] varibles defination « PHP « IT news, forums, messages
RE: [PHP] varibles defination

Posted by Jim Moseby on 08/02/05 18:24

> If I want to define and display a set of varibles, for example :
> $func1 = 0
> $func2 = 1
> $func3 = 2
> $func4 = 3
> $func5 = 4
>
> How can we define and display the varibles by using for loop
> function ?

<?php
for ($x=0;$x<10;$x++){
$func[$x]=$x;
}
print_r($func);
?>

This uses an array, so, in this case, your variables would be referenced as
$func[0]..$func[9].

JM

 

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

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