I using this code
$dato = array_shift($datos);
while($dato!=''){...}
Is it correct?
Is the same to put:
while($dato!=''){...}
Than
while($dato!=null){...}
Edit: This is on the oficial documentation php
Returns the shifted value, or NULL if array is empty or is not an array.
But my code is actually running
I think you are trying to check the value is empty in any array
while(!empty($dato)){...}
NULL = Doesn't exist
'' = Exists but it's empty
You can validate in many ways :
is_null(mixed $var)
set(mixed $var)
empty(mixed $var)
==
, ===
or !=