Re: serialization: again

From: Date: Tue, 25 Jul 2000 22:16:11 +0000
Subject: Re: serialization: again
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-8177@lists.php.net to get a copy of this message
Hello Baurjan, On 25-Jul-00 04:28:58, you wrote: >i'm trying to create a simple form designer. >it is, basically, as follows: >* "form designer" generates form definitions in xml (btw, is there such a dtd >already available?); W3C XForms, but I'm afraid the specification is not very realistic given the capabilities of the current browsers. How are you expected to implement masks (for instance for telefone numbers ###.###.###)? In the current browsers there seems to be no way to implement that with single text fields. How about money with localized ways to represent cents and thousands separators as well currency signs ($ sign, EURO sign)? You can require the user to type them but that's annoying for the users >* "form compiler" parses form definition files and serializes the resulting >tree. >* php scripts unserialize desired form and send it to the client. >being new to php, i've looked through the list archives. there are a lot of >discussion threads, focussed mainly on the implementability of one or other >method in php. what i'm looking for is a concrete way to implement >(un)serializing. i.e., i'm currently stucked on technical problems, that is, >how do i flush the data to the disk and how do i restore it. If you read PHP manual you realize that there are functions to serialize and unserialized any type of variable. While you are XML parsing, you may want to look at this PHP class that parses any XML file and build an associative array on which every XML tag or data has an entry of the array indexed by the element encoded path. Incidently the class is able to cache parsed data that is serialized and stored in a disk file. Next time the same file is parsed the structure array is read from disk and unserialized which usually is much faster than parsing the file again. http://phpclasses.UpperDesign.com/browse.html/package/4 Regards, Manuel Lemos Web Programming Components using PHP Classes. Look at: http://phpclasses.UpperDesign.com/?user=mlemos@acm.org -- E-mail: mlemos@acm.org URL: http://www.mlemos.e-na.net/ PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp --

« previous php.general (#8177) next »