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"]));
by Guram Azarashvili
2 years ago
PHP
Solutions
0
Pro tip: use ```triple backticks around text``` to write in code fences