Jump to content

Archived

This topic is now archived and is closed to further replies.

theweirdone

String To Array

Recommended Posts

Ok, so what I'm trying to do is to check a string ($song) for apostrophes (donno how to spell it, this thing: " ' ") and put a backslash in front of it... I'm not too sure about how I go around doing it. I've created a function which is suppose to break up the string into an array.
I'm having trouble with this, I've tried using split(), but I don't want it to split with a pattern, I want it just to split every character into a seperate subset of the array.. Is that possible, or is there another way for me to go about doing this? Any help is appreciated...

Share this post


Link to post
Share on other sites
Be a little more specific, what is it that you're trying to do? It sounds like you're just trying to stripslashes ??? Otheriwse str_split will convert a string to an array. You could also try eregi_replace to replace ' with \' if that is what you'd like. (if that was the wrong slash just use the right one) At any rate read about these functions if you have more questions at php.net.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.