This works on localhost but not on server:
$x = preg_split("/#/", $val)[0];
I have wasted like 4 hours to notice that this was the problem. On the server no errors were shown and the php file was interpreted in a very strange way, if I had a die('ok')
before this line it won't show anything.
$x = preg_split("/#/", $val);
$x = $x[0];
Works on server too.
And it's not about preg_split
, it is the same with every function that returns an array.