Error Call to undefined function split ()

3

if(isset($_POST['lista']) && $_POST['delimitador'])
{
    separar(trim($_POST['lista']), $_POST['delimitador']);
}
function separar($lista, $delimitador){
$ab = split("\n", $lista); //está é a linha 31 aonde o erro e apresentado
$cb = count($ab);
for($x = 0; $x < $cb; $x++){
    list($card, $mes, $ano, $cvv) = split("\".$delimitador, $ab[$x]);
    testar($card, $mes, $ano, $cvv);
    flush();
    ob_flush();
}
}
function getStr($string,$start,$end){
    $str = explode($start,$string);
    $str = explode($end,$str[1]);
    return $str[0];
}
    
asked by anonymous 07.08.2017 / 22:48

1 answer

5

The split () function has been removed from php7. The nearest one is explode() or preg_split() .

Change the lines:

$ab = split("\n", $lista);
list($card, $mes, $ano, $cvv) = split("\".$delimitador, $ab[$x]);

To:

$ab = explode("\n", $lista);
list($card, $mes, $ano, $cvv) = explode("\".$delimitador, $ab[$x]);
    
07.08.2017 / 22:50