Jump to content


Photo

String To Array


  • Please log in to reply
2 replies to this topic

#1 theweirdone

theweirdone
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 29 June 2006 - 07:06 PM

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...
¯|¯µ€W€¦®ÐØÑ€

#2 Buyocat

Buyocat
  • Members
  • PipPipPip
  • Advanced Member
  • 267 posts

Posted 29 June 2006 - 07:15 PM

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.
Looking for some easy-to-use tools?  Try these, https://sourceforge....jects/utils-php -- I made them myself.  They're distinct tools which are easy to understand and use.  See some examples uses at http://www.anotherearlymorning.com

#3 theweirdone

theweirdone
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 29 June 2006 - 07:41 PM

that will work nicely... thanx...
¯|¯µ€W€¦®ÐØÑ€




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users