sloth456 Posted March 31, 2009 Share Posted March 31, 2009 say I have a large array of words e.g: apple,pear,orange,etc I would like to split the aray into smaller arrays every 500 characters, without actually splitting any words. Is there an easy way to do that. If you need me to explain again I'd be happy to. Quote Link to comment Share on other sites More sharing options...
Brian W Posted March 31, 2009 Share Posted March 31, 2009 Possibly there is a better way, but you could use $block = wordwrap($string, 500);//500 characters long $array = explode("\n", $block);//break up the block on newlines Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.