--- Reuben D. Budiardja wrote:
> I did strive for that. But whatever character I choose, the problem
> remains that we can't guarantee that it's going ot be only used as
> deliminater, since the deliminated string is an input from user. So
> the problem remains.

Well, just to point out, your delimiter can be anything, including:

)[EMAIL PROTECTED]&*(donotusethisstringofcharactersinanything(*&[EMAIL PROTECTED])

Of course, at some point, that method of playing with probability becomes
unrealistic, and it is imperfect.

John's suggestion of URL encoding is likely your best bet. Given your string:

$foo:$bar:$blah

Make that instead:

urlencode($foo) . '&' . urlencode($bar) . '&' . urlencode($blah)

Then you can use & as your delimiter and be guaranteed that it does not exist
within each string. It is also easy to recover the original strings, and since
you are using PHP functions, there is less code to write (always a big plus).

Hope that helps.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to