Created
April 27, 2015 09:30
-
-
Save rafasashi/df1fc420cdf0aaa46ca7 to your computer and use it in GitHub Desktop.
custom ftok function for windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function custom_ftok($pathname='', $proj=''){ | |
$ftok=false; | |
if(function_exists('ftok')){ | |
$ftok = ftok($pathname, $proj); | |
} | |
else{ | |
$pathname = $pathname . (string) $proj; | |
for($key = array(); sizeof($key) < strlen($pathname); $key[] = ord(substr($pathname, sizeof($key), 1))); | |
$ftok = dechex(array_sum($key)); | |
} | |
return $ftok; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment