3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array ( 0 => 'FOLDER./Images.Vacation.2018', 1 => './Images.Vacation.2018/Racoon001.jpg', 2 => './Images.Vacation.2018/Racoon002.txt', 3 => './Images.Vacation.2018/the.racoon.swimming.mp4', 4 => './Images.Vacation.2018/the.racoon.swimming.slv', 5 => 'FOLDER./WestImages', 6 => './WestImages/Ramco.txt', 7 => './WestImages/Ramco.jpg', 8 => 'FOLDER./WestImages/Subimages', 9 => './WestImages/Subimages/Image001.jpg', 10 => './WestImages/Subimages/Image002.jpg', 11 => './WestImages/West.Ramco.Swimming.mp4', ); $folders = preg_grep("/^FOLDER.*/", $arr); foreach($folders as $folder){ $result[] = $folder; $result = array_merge($result, preg_grep("/^\." . str_replace(["FOLDER.", "/"], ["","\/"], $folder) . "\/[A-Za-z0-9\.]+$/", $arr)); } var_dump($result);
Output for git.master, git.master_jit, rfc.property-hooks
array(12) { [0]=> string(28) "FOLDER./Images.Vacation.2018" [1]=> string(36) "./Images.Vacation.2018/Racoon001.jpg" [2]=> string(36) "./Images.Vacation.2018/Racoon002.txt" [3]=> string(46) "./Images.Vacation.2018/the.racoon.swimming.mp4" [4]=> string(46) "./Images.Vacation.2018/the.racoon.swimming.slv" [5]=> string(18) "FOLDER./WestImages" [6]=> string(22) "./WestImages/Ramco.txt" [7]=> string(22) "./WestImages/Ramco.jpg" [8]=> string(36) "./WestImages/West.Ramco.Swimming.mp4" [9]=> string(28) "FOLDER./WestImages/Subimages" [10]=> string(35) "./WestImages/Subimages/Image001.jpg" [11]=> string(35) "./WestImages/Subimages/Image002.jpg" }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
25.13 ms | 407 KiB | 5 Q