Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
$path = "/var/www/mysite/data/img/cat.jpg";
$info = pathinfo($path, PATHINFO_EXTENSION);
//echo $info;
$images = mkdir(
'my documents', [
mkfile('avatar.jpg', ['size' => 100]),
mkfile('passport.jpg', ['size' => 200]),
mkfile('family.jpg', ['size' => 150]),
mkfile('addresses', ['size' => 125]),
mkdir('presentations')
]
);
$map = $filtered_images = array_filter(array_map(function ($file_name) {
return strpos($file_name, '.jpg') !== false ? $file_name : null;
}, $images));
echo $map;