|
Posted by Toby A Inkster on 02/13/07 16:26
Alfred wrote:
> - I fear storing the data as htmlentity, hexadecimal, or octal because
> it adds huge width to the text column in the database. So, storing it
> in some other format like slash-delimited would be best.
Encode:
$encoded = addcslashes($raw, "\0..\37!@\177..\377");
(Remember that you must still use pg_escape_string() before you insert into
the database!)
Decode:
$raw = stripcslashes($encoded);
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux
* = I'm getting there!
Navigation:
[Reply to this message]
|