No, there's no "integrate" function - if you want one of those you'd need a mathematics processor, which would probably have about a thousand pages of code dedicated to the task. Integration is not that simple!
You could do it numerically with any of the existing numeric integration algorithm's (midpoint, trapezoid, Simpson's, etc.); integrate from the mean to $xvar - if $xvar is less than the mean, then subtract it from 0.5, and if $xvar is greater than the mean, add 0.5 (that way, the other half on the other side of the mean is accounted for).
Anyhoo.
/ p
| gaussianPDF(x) dx
/ -inf
= (erf(sqrt(2)*p/2)+1)/2
where erf() is the error function
2x /1 2 2
erf(x) = -- | exp(x t )dt
pi /0
Hang on a tick - I think I might have some code for that lying around here somewhere.
Er, I do, but it's over two hundred lines long. It's probably simpler to evaluate the integral used in the error function numerically. Alternatively you could use the expansion
x inf (-x^2)^j
erf(x) = --- SUM ---------
2pi j=0 j!(j+1/2)
for as many terms as makes sense (about 3+9the size of x).
Hm. Looking at the notes I have on the subject, I think they could be translated into PHP as
function erf($x)
{
if(1.5>=abs($x))
{
$f = 1;
for($j = 3+(int)(9*abs($x)); $j!=0; --$j)
{
$f = 1+$f*$x*$x*(1/2-$j)/($j*(1/2+$j));
}
$f = $f*$x*2/M_SQRT_PI;
}
else
{
$f = 0;
for($j=3+(int)(32/abs($x)); $j; --$j)
{
$f = 1/($f*$j+M_SQRT2*$x);
}
$f *= -sqrt(2/M_PI)*exp(-$x*$x)+1
}
return $f;
}
But not only have I not tested that, I haven't even tried to run it. The function is well-behaved enough that numerical integration (either of the integral in erf(x) or of the original pdf) should be reliable.