What is use of _pre() method in codginiter (CI):
<?php
$x = array('hello', 'ram', 'shyam');
_pre($x);
die;
?>
It's a shorthand to output your array in <pre> tags, though it's likely a user contribution and not part of the core framework.
Here's the function basically:
function _pre($arr)
{
echo '<pre>' . print_r($arr, true) . '</pre>';
}
Now it will output your array using this formatting...
Array
(
[0] => hello
[1] => ram
[2] => shyam
)
...instead of this formatting:
Array ( [0] => hello [1] => ram [2] => shyam )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With