I would like to show some simple examples for matrix and vector arithmetic in PHP with NumPHP.
I assume that NumPHP is installed with composer.
$matrix1 = new NumArray(
    [
        [   2, -45, -9/2],
        [ 7.7,  -2,    8]
    ]
);
$matrix2 = new NumArray(
    [
        [ 7/8,    -7],
        [   4, 0.091],
        [   0,   -34]
    ]
);
$matrix1->dot($matrix2);
echo $matrix1;
The output of this example will be
NumArray([
  [-178.25, 134.905],
  [-1.2625, -326.082]
])
// this will create a 3x3 matrix with entries from 1 to 9
$matrix = NumPHP::arange(1, 9)->reshape(3, 3);
$vector = new NumArray(
    [3/4, -5, 8.7]
);
$matrix->dot($vector);
echo $matrix;
The output of this example will be
NumArray([16.85, 30.2, 43.55])
More matrix and vector arithmetic operation can be found under readthedocs.org