[PHP] writing to a file

2002-03-06 Thread Marc-Andre Vallee

Hi,

Here is a foo.txt file :

name=foo
age=100
sex=y

I want to open the file, find the age line, and then replace the 100 with
another value.
The only way i see, is to rewrite the entire file

Maybe this is a stupid question, but, i tried the online doc, and saw
nothing about this

Thanks a lot

Marc-Andre Vallee
[EMAIL PROTECTED]




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




[PHP] writing to a file

2002-03-06 Thread Marc-Andre Vallee

Hi,

Here is a foo.txt file :

name=foo
age=100
sex=y

I want to open the file, find the age line, and then replace the 100 with
another value.
The only way i see, is to rewrite the entire file

Maybe this is a stupid question, but, i tried the online doc, and saw
nothing about this

Thanks a lot



--

Marc-Andre Vallee
[EMAIL PROTECTED]




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




[PHP] french date

2001-09-19 Thread Marc-Andre Vallee

Hi
i want to print the date in french
i use the function setlocale
(http://www.php.net/manual/en/function.setlocale.php)
and then i use the function strftime
(http://www.php.net/manual/en/function.strftime.php)
but, on my slackware 8 distribution, compiled with php 4.0.6 & apache 1.3.20
it doesn't works
maybe, i need a slackware package
witch one 

thanks a lot

--
Marc-Andre Vallee
[EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: passing parameters from the command line

2001-09-24 Thread Marc-Andre Vallee

use the C style constant
argv[]
argc

and call your .php like this
foo.php 1 5

then, argv[1] = 1
and,  argv[2] = 5

--
Marc-Andre Vallee
[EMAIL PROTECTED]


"Bill" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> When PHP is being run as cgi, I can pass parameters in the url like
> this:
>
> http://mysite.com/phpfile.cgi?var1=5&var2=7
>
> Which will get me var1 as 5 and var2 as 7.
>
> I want to run this cgi PHP script as a cron job.
>
> So, I'm wondering how to pass it parameters from the command line.
>
> kind regards,
>
> bill hollett
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]