Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- In browser debugging print_r and vardump is not enough and lots of developers have to each time wrap with <pre>
- I created and using following function as set globally in bootstrap file and it makes debuggig easier and better readability
- ```
- /**
- @param $mixed mandatory any data type
- @param $die optional , default true
- @param $varDump optional , default false
- @return preformatted print_r or vardump output
- */
- //you can rename this function as per your convenience ex: _dbg , _debug etc. enjoy debugging
- function print_pre($mixed,$die=true,$varDump=false){
- echo '<pre>';
- if($varDump)
- var_dump($mixed);
- else
- print_r($mixed);
- echo '<pre>';
- if($die)
- die('__END__');
- }
- ```
Add Comment
Please, Sign In to add comment