I want this to execute the following code in PHP
linspace(1,7,4);
I want to have linear array list as an output.
I want this to execute the following code in PHP
linspace(1,7,4);
I want to have linear array list as an output.
function linspace($i,$f,$n){
$step = ($f-$i)/($n-1);
return range ($i,$f,$step);
}
$test = linspace(0,3.14159,8);
print_r($test);
I have written my own in some minutes. Please test it out.