Skip to main content
Commonmark migration
Source Link

#PHP 135 Bytes

PHP 135 Bytes

I know I'm late but I wanted to post anyway:

function a($b){
  $b=strtoupper($b);
  foreach(range('A','Z') as $c){
   $d[$c]=substr_count($b, $c);
  }  
  arsort($d);
  return implode(array_keys($d));
}
echo a($z); //let $z be the supplied string.

golfed:

function a($b){$b=strtoupper($b);foreach(range('A','Z') as $c){$d[$c]=substr_count($b, $c);}arsort($d);return implode(array_keys($d));}echo a($z); 

#PHP 135 Bytes

I know I'm late but I wanted to post anyway:

function a($b){
  $b=strtoupper($b);
  foreach(range('A','Z') as $c){
   $d[$c]=substr_count($b, $c);
  }  
  arsort($d);
  return implode(array_keys($d));
}
echo a($z); //let $z be the supplied string.

golfed:

function a($b){$b=strtoupper($b);foreach(range('A','Z') as $c){$d[$c]=substr_count($b, $c);}arsort($d);return implode(array_keys($d));}echo a($z); 

PHP 135 Bytes

I know I'm late but I wanted to post anyway:

function a($b){
  $b=strtoupper($b);
  foreach(range('A','Z') as $c){
   $d[$c]=substr_count($b, $c);
  }  
  arsort($d);
  return implode(array_keys($d));
}
echo a($z); //let $z be the supplied string.

golfed:

function a($b){$b=strtoupper($b);foreach(range('A','Z') as $c){$d[$c]=substr_count($b, $c);}arsort($d);return implode(array_keys($d));}echo a($z); 
Remove incorrect byte count. See my comment
Source Link
TecBrat
  • 222
  • 1
  • 9

#PHP 135 146135 Bytes

I know I'm late but I wanted to post anyway:

function a($b){
  $b=strtoupper($b);
  foreach(range('A','Z') as $c){
   $d[$c]=substr_count($b, $c);
  }  
  arsort($d);
  return implode(array_keys($d));
}
echo a($z); //let $z be the supplied string.

golfed:

function a($b){$b=strtoupper($b);foreach(range('A','Z') as $c){$d[$c]=substr_count($b, $c);}arsort($d);return implode(array_keys($d));}echo a($z); 

#PHP 135 146 Bytes

I know I'm late but I wanted to post anyway:

function a($b){
  $b=strtoupper($b);
  foreach(range('A','Z') as $c){
   $d[$c]=substr_count($b, $c);
  }  
  arsort($d);
  return implode(array_keys($d));
}
echo a($z); //let $z be the supplied string.

golfed:

function a($b){$b=strtoupper($b);foreach(range('A','Z') as $c){$d[$c]=substr_count($b, $c);}arsort($d);return implode(array_keys($d));}echo a($z); 

#PHP 135 Bytes

I know I'm late but I wanted to post anyway:

function a($b){
  $b=strtoupper($b);
  foreach(range('A','Z') as $c){
   $d[$c]=substr_count($b, $c);
  }  
  arsort($d);
  return implode(array_keys($d));
}
echo a($z); //let $z be the supplied string.

golfed:

function a($b){$b=strtoupper($b);foreach(range('A','Z') as $c){$d[$c]=substr_count($b, $c);}arsort($d);return implode(array_keys($d));}echo a($z); 
deleted 3 characters in body
Source Link
cat
  • 5.9k
  • 2
  • 26
  • 44

#PHP 135 146 Bytes

I know I'm late but I wanted to post anyway:

PHP 135 146 Bytes

function a($b){
  $b=strtoupper($b);
  foreach(range('A','Z') as $c){
   $d[$c]=substr_count($b, $c);
  }  
  arsort($d);
  return implode(array_keys($d));
}
echo a($z); //let $z be the supplied string.

echo a($z); //let $z be the supplied string.

golfed:

function a($b){$b=strtoupper($b);foreach(range('A','Z') as $c){$d[$c]=substr_count($b, $c);}arsort($d);return implode(array_keys($d));}echo a($z); 

I know I'm late but I wanted to post anyway:

PHP 135 146 Bytes

function a($b){
  $b=strtoupper($b);
  foreach(range('A','Z') as $c){
   $d[$c]=substr_count($b, $c);
  }  
  arsort($d);
  return implode(array_keys($d));
}

echo a($z); //let $z be the supplied string.

golfed:

function a($b){$b=strtoupper($b);foreach(range('A','Z') as $c){$d[$c]=substr_count($b, $c);}arsort($d);return implode(array_keys($d));}echo a($z); 

#PHP 135 146 Bytes

I know I'm late but I wanted to post anyway:

function a($b){
  $b=strtoupper($b);
  foreach(range('A','Z') as $c){
   $d[$c]=substr_count($b, $c);
  }  
  arsort($d);
  return implode(array_keys($d));
}
echo a($z); //let $z be the supplied string.

golfed:

function a($b){$b=strtoupper($b);foreach(range('A','Z') as $c){$d[$c]=substr_count($b, $c);}arsort($d);return implode(array_keys($d));}echo a($z); 
Source Link
TecBrat
  • 222
  • 1
  • 9
Loading