how to debug in php
ini_set('display_errors', 'On');
error_reporting(E_ALL);
how to debug in php
ini_set('display_errors', 'On');
error_reporting(E_ALL);
write php online
Try this sites to write php code online:
http://www.writephponline.com/
http://sandbox.onlinephpfunctions.com/
https://paiza.io/en/projects/new
http://phptester.net/
https://www.tutorialspoint.com/execute_php_online.php
https://rextester.com/l/php_online_compiler
http://phpfiddle.org/
https://repl.it/languages/php_cli
https://www.jdoodle.com/php-online-editor/
debug php
// ------ string -------
// use echo, exit for output
$a = 123
echo ($a);
exit;
// ------ array -------
$array = array(
1 => 'apple',
2 => 'banana',
)
// Method 1
echo "<pre>";
print_r($array);
echo "</pre>";
// Method 2
echo "<pre>";
var_dump($array);
echo "</pre>";
// Method 3 (no need exit) beacause of dd is already exit
dd($array)
// Method 4 (cakephp)
pr ($array);
// ------ json -------
$json = {"a":"123"}
pr (json_encode($json));
exit;
print_r (json_encode($json));
exit;
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us