-1

I have a piece of code that's using the split() function. PHP is complaining that the function is deprecated. How can this be converted to a non deprecated split?

if(!empty($vis_settings['url']['urls'])){
    $split_urls=split("[\n ]+",(string)$vis_settings['url']['urls']);
RegEdit
  • 2,134
  • 10
  • 37
  • 63
  • Look into `preg_split()` – Divey Aug 23 '13 at 19:08
  • 2
    In the future, it is faster for you to just look up the actual PHP documentation. Just posting this without doing any sort of research is rather lazy and distracts users from more meaningful questions. – thatidiotguy Aug 23 '13 at 19:10

1 Answers1

2

You can use preg_split.

$split_urls = preg_split("/[\n ]+/",(string) $vis_settings['url']['urls']);
som
  • 4,650
  • 2
  • 21
  • 36