Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function clean($string) {
- $string = str_replace('-', '_', $string); // Replaces all spaces with hyphens.
- return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars.
- }
- $files = scandir(getcwd());
- //print_r($files);
- for($i=2 ; $i<count($files) ;$i++){
- $con = explode('.', $files[$i]);
- if($con[0] != "index123"){
- $func_name = clean($con[0]);
- echo ' public function '.$func_name.'()
- {
- $this->load->view("'.$con[0].'");
- }
- </br>';
- }
- }
- ?>
Add Comment
Please, Sign In to add comment