First of all identify the file(s) for which you want to know the revision number from PHP. Then add a property to the file as follows:
svn propset svn:keywords Revision file_name.php

Now add the following function within php blocks:

/** Returns revision number */
function getSCID() {
    $svnid = '$Rev: 43 $';
    $scid = substr($svnid, 6);
    return intval(substr($scid, 0, strlen($scid) - 2));
}

You can now access the revision number of this file from PHP by calling getSCID(). It returns an integer.

Note: Revision numbers are essential in writing upgrade scripts