NYCPHP Meetup

NYPHP.org

[nycphp-talk] strings: adding tokens

David Sklar sklar at sklar.com
Tue Apr 13 16:43:23 EDT 2004


> I'm trying to take a string like: 'abcd' and add a fwd slash every other char, like: 'a/b/c/d/' -

$str = implode('/',preg_split('/\b|\B/',$str,-1,PREG_SPLIT_NO_EMPTY)).'/';

David




More information about the talk mailing list