Jump to content

String To Array


theweirdone

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...
Link to comment
https://forums.phpfreaks.com/topic/13238-string-to-array/
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.
Link to comment
https://forums.phpfreaks.com/topic/13238-string-to-array/#findComment-50964
Share on other sites

Archived

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

×
×
  • Create New...

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.