[Phpmyadmin-devel] PHP3 -> PHP4

Garvin Hicking garvinhicking at gmx.de
Thu Nov 20 06:58:08 CET 2003


Hi All

Who wants to make this function from libraries/sqlparser.lib.php 
PHP4-enhabled? As I'm not familar using strpos/strcomp and really don't 
know what the function is about, I don't want to screw that one up. :-)

--------------
        function PMA_SQP_typeCheck($toCheck, $whatWeWant)
        {
            $typeSeperator = '_';
            if(strcmp($whatWeWant, $toCheck) == 0) {
                return TRUE;
            } else {
                //if(strpos($whatWeWant, $typeSeperator) === FALSE) {
                // PHP3 compatible (works unless there is a real ff 
character)
                if(!strpos("\xff" . $whatWeWant, $typeSeperator)) {
                    return strncmp($whatWeWant, $toCheck , 
strpos($toCheck, $typeSeperator)) == 0;
                } else {
                    return FALSE;
                }
            }
        }
---------------

Regards,
Garvin.





More information about the Developers mailing list