Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(0);
- // fungsi include + data array (jika ada)
- function render($n, $data = []) {
- return include_once $n . '.php';
- }
- // menghapus spasi dia antara koma
- function nospace($n) {
- $n = str_replace(", ", ",", $n);
- $n = str_replace(" ,", ",", $n);
- return $n;
- }
- // fungsi looping + include + data array (jika ada)
- function loopinc($file, $data = []) {
- $include = explode(',', nospace($file));
- $loop = count($include) - 1;
- for ($i=0; $i <= $loop; $i++) {
- @render($include[$i], $data);
- }
- }
- Class loop {
- public static function inc($file = array(), $data) {
- foreach ($file as $files) {
- include_once $files.'.php';
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement