|
Posted by Andy Jeffries on 07/19/06 11:07
On Tue, 18 Jul 2006 21:28:13 -0700, Manish wrote:
> #1
> ID [4 bytes]: Subject [100 bytes]: To Address[100 bytes]: From Address[100
> bytes]...etc...
>
> #2
> 1324#|#Hi, How are you#|#me@google.com#|#you@google.com#|# ... and so on
>
>
> Which of these will be the efficeint one (as there will be frequent
> insert/delete/update of the individual information, eg. set message as
> read ..., delete message ..., new message ...)
The first one will be more efficient from a search/replace point of view,
the second will be more efficient from a space usage point of view.
Efficiency is subjective.
> Also please suggest on how to determine the variable size (100 bytes as
> in #1), and assign the size to the variable accordingly and read it
> (differentiate multiple variables) when required.
substr would be used to cut out various portions of the string (e.g. 100
charactes starting at position 4) and sprintf (or fprintf to do it in PHP5
if you're using PHP5 to save a step).
If you need more than a pointer to the right functions, then it's starting
to sound like a homework assignment and I wish you luck with it...
Cheers,
Andy
--
Andy Jeffries MBCS CITP ZCE | gPHPEdit Lead Developer
http://www.gphpedit.org | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos
[Back to original message]
|