function getExtension($file){
	$exts = [];
	foreach($file as $f){
		$info = pathinfo($f);
		//print_r($info);
		$exts []= $info['extension'];
	}
	return $exts;
};
print_r(getExtension(["ruby.rb", "cplusplus.cpp", "python.py", "javascript.js"]));
print_r(getExtension(["code.html", "code.css"]));
<?php
function calculatescore($x) {
return [
    substr_count($x, 'Y'), //substr_count-Counts how many times this data is given
    substr_count($x, 'O'),
    substr_count($x, 'U')
     ];
}
print_r (calculatescore("YOU")); // 1,1,1
print_r (calculatescore("YYOOUU)); //2,2,2
print_r (calculatescore("UUUOOYYYY)); //3,2,4
<?php
function beautiful($o) {
return substr_count($o, 010);
}
print_r (beautiful(0100100100100100111010101001011010); //output- 6
<?php
function number($x) {
if ($x % 2) {
               echo " even";
        } else {
              echo "odd";
    }
      echo (number(100)); \\result- even
      echo (number(23));\\ result- odd
}
<?php
 
function code($code) {
$x=strlen($code);
if ($x == 4) {
              echo "true";
        } else if ($x==6) {
              echo "true";
        } else {
              echo "false"
     }
}
echo (code(1234)); \\result-true
echo (code(a4b56r)); \\result-true
echo (code(t674rhedbt8w39); \\result-false