/ Published in: PHP
pass in a php class and sort the methods alphabetically. great for 'fucking huge' class files where you can't find methods.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php $file = 'path-to-class-file'; if ($file_contents !== NULL) { $file_contents = trim(str_replace(array('<?php', '<?', '?>'), '', $file_contents)); // remove php tags foreach ($functions as $f_key => $function) { if ($f_key == 0) { $class_start = $key; } else { $functions_array[$key] = $function; } } echo '<textarea style="width:100%;height:100%">'; echo '<?php' . "\n" . $class_start . "\n\n" . 'function ' . implode('function ', $functions_array) . "\n\n" . '}'; echo '</textarea>'; } ?>