Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $s=trim(strtolower($name));
- $n=strlen($s);
- if($n>90) $n=90;
- for($i=0;$i<$n;$i++)
- {
- //===========bila bukan a-z atau 0-9 ganti -
- $ordChr=ord($s[$i]);
- $stat=FALSE;
- if($ordChr >= 48 && $ordChr <=57)
- {
- $stat=TRUE;
- }
- if($ordChr >= 97 && $ordChr <=122)
- {
- $stat=TRUE;
- }
- if(!$stat)
- {
- $s[$i]="_";
- }else{
- //echo $s[$i].$ordChr;
- }
- }
- $basename=$s;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement