note 115303 added to function.require-once

From: Date: Wed, 02 Jul 2014 15:38:00 +0000
Subject: note 115303 added to function.require-once
Groups: php.notes 
Request: Send a blank email to php-notes+get-199810@lists.php.net to get a copy of this message
i have created a simple function to multi require once function mrequire($array){ //if it isn't an array require_once as string if(!is_array($array)){ require_once($array); }else{ //else it count the lenght of array and do a for to require_once all the value of an array $lenght=count($array); for($i=0;;$i++){ if($lenght==$i){break;} require_once($array[$i]); } } } //example of use mrequire(["aclass.php","secondclass.php"]); mrequire("thisisuseless.php"); ---- Server IP: 81.88.49.10 Probable Submitter: 151.48.230.88 ---- Manual Page -- http://php.net/manual/en/function.require-once.php Edit -- https://master.php.net/note/edit/115303 Del: integrated -- https://master.php.net/note/delete/115303/integrated Del: useless -- https://master.php.net/note/delete/115303/useless Del: bad code -- https://master.php.net/note/delete/115303/bad+code Del: spam -- https://master.php.net/note/delete/115303/spam Del: non-english -- https://master.php.net/note/delete/115303/non-english Del: in docs -- https://master.php.net/note/delete/115303/in+docs Del: other reasons-- https://master.php.net/note/delete/115303 Reject -- https://master.php.net/note/reject/115303 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#199810) next »