SHARE
TWEET

Untitled

a guest Oct 28th, 2015 108 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // 135 chars – supposing notices are silenced through error_reporting
  2. function f($n,&$l){foreach(str_split($n)as$c){$b=0;foreach([9=>0,Z=>A,z=>a]as$m=>$i)$c<=$m&&$c>=$i&&$b=join(range($i,$c));$l.=$b?:$c;}}
  3.  
  4. // 147 chars – the same without notices
  5. function f($n,&$l){foreach(str_split($n)as$c){$b=0;foreach(['9'=>'0','Z'=>'A','z'=>'a']as$m=>$i)$c<=$m&&$c>=$i&&$b=join(range($i,$c));$l.=$b?:$c;}}
  6.  
  7. // 140 chars – still no notices, but less strings
  8. function f($n,&$l){foreach(str_split($n)as$c){$b=0;foreach(['90','ZA','za']as$m)$c<=$m[0]&&$c>=$m[1]&&$b=join(range($m[1],$c));$l.=$b?:$c;}}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top