Access data as a PHP array.
array
NdArray::data
A PHP array like [1, 2, 3]
use SciPhp\NumPhp as np;
$m = np::linspace(1, 9, 9)->reshape(3, 3)->power(2);
$d = $m->data;
echo "m\n$m", "data\n" . print_r($d, true);
The above example will output:
m
[[2 4 8 ]
[16 32 64 ]
[128 256 512]]
data
Array
(
[0] => Array
(
[0] => 2
[1] => 4
[2] => 8
)
[1] => Array
(
[0] => 16
[1] => 32
[2] => 64
)
[2] => Array
(
[0] => 128
[1] => 256
[2] => 512
)
)