Re: few additions?
| From: | Thies C. Arntzen | Date: | Wed, 23 Sep 1998 18:30:57 +0000 |
| Subject: | Re: few additions? | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-1445@lists.php.net to get a copy of this message | ||
hi, i'm not a php-core team - but i would love to take a look at it....
could you send me your patches via mail???
regards,
tc
On Wed, 23 Sep 1998, Jani Lehtimäki wrote:
>
> hello,
>
> i started experimenting today and created to functions
>
> [structure] var_load($filename);
> [boolean] var_save($structure, $filename);
>
> basically these functions load and save any structure containing
> scalars, arrays and objects. i've been using php-version of these quite a
> long but they were so damn slow, so due that i programmed c-version.
>
> for instance:
>
> $a["one"] = array(10,20,30,40);
> $a[55] = array(10.34,20,"test",40);
> $b["field_1"] = 100;
> $b["field_2"] = 200;
> settype($b, "object");
> $x[] = $a;
> $x[] = $b;
>
> var_save(&$x, "/var/tmp/foo.bar");
>
> creates file which contains:
>
> a:2:{
> i:0
> a:2:{
> s:3:'one'
> a:4:{
> i:0
> i:10
>
> i:1
> i:20
>
> i:2
> i:30
>
> i:3
> i:40
> }
>
> i:55
> a:4:{
> i:0
> d:10.34
>
> i:1
> i:20
>
> i:2
> s:4:'test'
>
> i:3
> i:40
> }
> }
>
> i:1
> o:2:{
> s:7:'field_1'
> i:100
>
> s:7:'field_2'
> i:200
> }
> }
>
> this can be retrieved back by simply saying
>
> $foo = var_load("/var/tmp/foo.bar");
>
>
> as far as i know there aren't currently such functions in php -- i'm
> happy to contribute.
>
> --jkl
>
>
> --
> PHP Development Mailing List http://www.php.net/
> To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
> For help: php-dev-help@lists.php.net
>
>
>
Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!"
Digital Collections Phone +49 40 235350 Fax +49 40 23535180
Hammerbrookstr. 93 20097 Hamburg / Germany
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net