将Coldfusion转换为PHP find('filename.cfm',cgi.script_name)

I am working on rewriting a Coldfusion script to a PHP script and I have never worked with either language. I am partway through with the conversion but I have run into part of the cf script that I am stuck on rewriting in PHP.

<cfset i_pos = find('index.cfm',cgi.script_name)>
<cfif i_pos GT 0>
    <cfset s = RemoveChars(cgi.script_name,i_pos,9)>
<cfelse>
    <cfset s = s = cgi.script_name>
</cfif>

I understand that 'find' will look for the first occurence of a substring but it appears that we are working with a file that gets the virtual path from cgi.script_name. I was thinking that I could use the following for php but I don't think it will work.

$filepath=dirnmae(__FILE__)
$i_pos = strstr('index.cfm', $filepath)

Any help would be appreciated