[thelist] PHP Challenge

Matt Warden mwarden at gmail.com
Thu Nov 24 01:44:32 CST 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

email wrote:
> Hello,
> 
> I'm wanting to interleave the characters of two strings to form one string.
> 
> For example:
> String1 - FOO
> String2 - evolt
> Interleaved(String1, String2) = FeOvOolt
> 
> But, not limited to just two strings.
> For example:
> String1 - FOO
> String2 - evolt
> String3 - 1234
> Interleaved(Interleaved(String1, String2), String3) = F1e2O3v4O5o6l7t8
> 
> I've made each "string" into its own array. ( e.g. array('F','O','O') )
> 
> I just can't get my head around it. Does anyone have any ideas?

Interesting problem.

Run:
http://mwarden.f2o.org/sandbox/interleaveStrings.php

Source:
http://mwarden.f2o.org/sandbox/viewsource.php?linemode=0&f=interleaveStrings.php

Example:
interleaveStringsArray( array('FOO', 'evolt', '1234') );


- --
Matt Warden
Miami University
Oxford, OH, USA
http://mattwarden.com


This email proudly and graciously contributes to entropy.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDhW9frI3LObhzHRMRAi2MAJ9JQrCkz+UyGnk7el87hB8wG+xN4wCgzAW9
YIRv4KG7jBSHQRFBRaMQIdQ=
=GMx0
-----END PGP SIGNATURE-----



More information about the thelist mailing list