7

How to fix this error.

Fatal error: Uncaught Error: Call to undefined function split() in /home/kmusi/public_html/base.php(725) : eval()'d code:9 Stack trace: #0 /home/kmusi/public_html/base.php(725) : eval()'d code(74): gregorian_to_jalaliq2a('1519984652') #1 /home/kmusi/public_html/base.php(761): when_to_html_override_1_in_gregorian2jalali_overrides_php('1519984652', '7') #2 /home/kmusi/public_html/base.php(822): call('when_to_html...', Array) #3 /home/kmusi/public_html/app/format.php(780): call_override('when_to_html', Array) #4 /home/kmusi/public_html/app/format.php(581): when_to_html('1519984652', '7') #5 /home/kmusi/public_html/app/format.php(826): post_html_fields(Array, 1, NULL, Array, NULL, Array) #6 /home/kmusi/public_html/app/format.php(986): other_to_q_html_fields(Array, 1, NULL, Array, NULL, Array) #7 /home/kmusi/public_html/app/list.p in /home/kmusi/public_html/base.php(725) : eval()'d code on line 9

Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
Akshay Kumar
  • 115
  • 1
  • 2
  • 7

2 Answers2

21

The split() function was removed in PHP 7. You can replace it with preg_split() or explode() function depending on the circumstances.

Jay Taylor
  • 13,185
  • 11
  • 60
  • 85
Igor Carvalho
  • 668
  • 5
  • 19
8

Replace split() with explode()

$string = "a, b, c";
$array = explode(", ", $string);

It will give you array with 3 values in it.

split was deprecated in previous version of php but I think in php 7 it is removed so this is why it is saying undefined.

Nick
  • 138,499
  • 22
  • 57
  • 95
Akhilesh
  • 927
  • 1
  • 6
  • 21