Sr. Web Developer
mediabistro.com
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume

Comments for: lorenso20021221.php3

Message # 1015344:
Date: 02/03/03 00:59
By: Benjamin Smith
Subject: Use the best option...

Yeah, XML is the current, "buzzword compliant" technology, but many times, life gets much easier if you reduce your problem set to its minimum.

For example, if you have a complex data structure you want to save to disk...

<?
// $arr is an array of whatever types of data
$fp=fopen('savefile', 'w');
fwrite($fp, serialize($arr));
fclose($fp);
?>

Wasn't that hard? Oh, but what about reading it?

<?
$fp=fopen('savefile, 'r');
$arr=unserialize(fread($fp, 1000000));
fclose($fp);
?>

Gee... which is better for saving your data?

XML is all fine and dandy, but remember that even buzzword-compliant technologies have their place.

Don't forget to consider the advantages and costs of any particular solution and those of reasonably available alternatives before you standardize on it!

Previous Message | Next Message


Comments:
function calling from java scriptlampsunil08/02/05 05:31
RE: Xml to Array, another simple solution...ans04/29/05 06:57
Another optionEdemilson Lima01/15/04 13:19
looking for solutionlakshman12/19/03 05:40
Excellent job!escobar09/16/03 13:09
computernorman02/28/03 05:59
Thanks for the excellent articleRob Keniger02/11/03 09:31
xml2array+array2xml alternativeTulpe02/03/03 08:35
Use the best option... Benjamin Smith02/03/03 00:59
Xml to Array, another simple solution...marcoBR01/10/03 20:51
XML module for PHPPhillip.01/10/03 13:27
Well doneSam12/30/02 16:01
ArrayRGJ12/27/02 08:53
Great article!Tormod12/25/02 11:38
 

If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly.

Add A Comment:

Name:

Email:

Subject:

Message:

To reduce spam posts, messages are now manually approved

You are not [logged in]. That means your account will not get credit for this post.