You are here: Re: Uisng a string varibale with an array « PHP Programming Language « IT news, forums, messages
Re: Uisng a string varibale with an array

Posted by David Haynes on 04/06/06 03:53

David Haynes wrote:
> Chris H wrote:
>> see the problem is i really need the array values to come from a
>> string variable, this way the administartor can easily set/modify the
>> payout percentage "range" witrhin teh variables.php file, so the admin
>> never has to be in the main parts of my code, i guess i could always
>> just use mySQL and have the ranges set in a table for the scripts
>> configs. altho i really am trying to keep from using MySQL so much to
>> relieve any server strain
>
>
> See that string in the explode function?
> What's wrong with that?
>
> How about this for clarity?
>
> <?php
> include_once('variables.php');
>
> $table = explode(',', $range1);
> printf("The first value is %f\n", $table[0]);
> printf("The second value is %f\n", $table[0]);
correction: should be $table[1]
> ?>
>
> [variables.php]
> $range1 = "0.60, 0.41, 0.20";
>

 

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

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