monkeytooth Posted October 28, 2010 Share Posted October 28, 2010 I'm trying to figure out how I can break a string down if the strings length is longer then lets say 140 characters including white space. At first I was figuring maybe maybe I could do something with explode or implode after I get a get my strings length but the string in question has no static values to them that would let me break it apart or put it back together. Now In most cases I would use substr() to return my 140 characters, however I need to take 140+ and make an array of the extra so I can run a for each on it. I am using this for an SMS app I am helping develop. I know I can limit my the output to only 140, just based on the notion that a single SMS is capped at 140-160 on most carriers. Unfortunately for me thats not the case so I need to break this apart and I am stumped, anyone got any ideas? Link to comment https://forums.phpfreaks.com/topic/217144-break-down-a-string/ Share on other sites More sharing options...
Pikachu2000 Posted October 28, 2010 Share Posted October 28, 2010 str_split(), perhaps? Link to comment https://forums.phpfreaks.com/topic/217144-break-down-a-string/#findComment-1127754 Share on other sites More sharing options...
monkeytooth Posted October 28, 2010 Author Share Posted October 28, 2010 HA! Yes, I don't know why I didn't think of that, thinking to outside the box I suppose lol, thank ya. Link to comment https://forums.phpfreaks.com/topic/217144-break-down-a-string/#findComment-1127778 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.