Jump to content


str_split not defined?


1 reply to this topic

#1 high6

    Young Padawan

  • Members
  • Pip
  • 57 posts

Posted 01 June 2007 - 10:18 PM

Well my friends host(I have a sub) has the latest php but the function http://www.php.net/m...n.str-split.php doesn't work? Is there a reason it wouldn't work or another function like that, that i can use instead?

#2 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 02 June 2007 - 12:10 AM

So you're saying your friend is running php 5? Or just the latest version of php 4? That would make a difference.

But, depending on exactly how you are using it, explode() would be your next best bet.
i.e.
explode('', $string);
// or
explode("\n", $string);
Of course, you could easily make a str_split function using a for loop.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users