Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize Online / SQLize Online  /  SQLtest Online

A A A
Login    Share code      Blog   FAQ

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

Copy Format Clear

Stuck with a problem? Got Error? Ask AI support!

Copy Clear
Copy Format Clear
<?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;
Copy Clear