Re: [PHP] How to read PHP variables.

2005-07-14 Thread Rory Browne
Thsi is way, way WAY too vague. 

What exactly do you need a patern for?

If you simply want to change it, then just do a $var['whatever'] =
value; again in the module you want to change it in. If you want to
redo the config file, then you can just loop through the array,
printing out, each value of the array as you go. Otherwise you could
just use var_export().

On 7/12/05, Bruno B B Magalhães [EMAIL PROTECTED] wrote:
 Hi you all!
 
 That's my problem: I have a configuration files with the following
 structure...
 
 $vars['varname'] = 'varvalue';
 
 And I would like to have a module to change those parameters, but I
 don't know how to write a pattern to match it...
 
 Thanks in advance...
 
 Best Regards,
 Bruno B B Magalhaes
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] How to read PHP variables.

2005-07-12 Thread yanghshiqi
Firstly, I don't know why you want to change your configuration in real
time?
Then if you just keep your configuration in an array, then when you want to
change and use it in your script, you can just $vars['varname'] = sth
else.
So pls give us more detail.

 
 
 
Best regards,
Shiqi Yang

-Original Message-
From: Bruno B B Magalhães [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 12, 2005 8:21 PM
To: php-general@lists.php.net
Subject: [PHP] How to read PHP variables.

Hi you all!

That's my problem: I have a configuration files with the following  
structure...

$vars['varname'] = 'varvalue';

And I would like to have a module to change those parameters, but I  
don't know how to write a pattern to match it...

Thanks in advance...

Best Regards,
Bruno B B Magalhaes

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to read PHP variables.

2005-07-12 Thread Ahmed Saad
Hi Bruno,

On 7/12/05, Bruno B B Magalhães [EMAIL PROTECTED] wrote:
 Hi you all!
 $vars['varname'] = 'varvalue';
 
 And I would like to have a module to change those parameters, but I
 don't know how to write a pattern to match it...

i think you mean an API to help you manage and persist your
application settings (something more or less like the Preferences API
in java) and your format have to be much simpler like .ini format (key
= value) or some variation

take a look at phpclasses.org search results for ini
http://www.google.com/custom?domains=www.phpclasses.orgq=inisa=Searchsitesearch=www.phpclasses.orgclient=pub-2951707118576741forid=1channel=5742870948ie=ISO-8859-1oe=ISO-8859-1cof=GALT%3A%23663399%3BGL%3A1%3BDIV%3A%2322%3BVLC%3A663399%3BAH%3Acenter%3BBGC%3AA3C5CC%3BLBGC%3AA3C5CC%3BALC%3AFF%3BLC%3AFF%3BT%3A00%3BGFNT%3AFF%3BGIMP%3AFF%3BLH%3A50%3BLW%3A256%3BL%3Ahttp%3A%2F%2Ffiles.phpclasses.org%2Fgraphics%2Fgooglesearch.jpg%3BS%3Ahttp%3A%2F%2Fwww.phpclasses.org%2Fsearch.html%3BFORID%3A1%3Bhl=en

an alternative way is using XML to store your settings and use the PHP
XML support for parsing/manipulating these files.

-ahmed

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php