debug logging php
<?php
//Something to write to txt log
$log = "User: ".$_SERVER['REMOTE_ADDR'].' - '.date("F j, Y, g:i a").PHP_EOL.
"Attempt: ".($result[0]['success']=='1'?'Success':'Failed').PHP_EOL.
"User: ".$username.PHP_EOL.
"-------------------------".PHP_EOL;
//Save string to log, use FILE_APPEND to append.
file_put_contents('./log_'.date("j.n.Y").'.log', $log, FILE_APPEND);<?php
function console_log($output, $with_script_tags = true) {
$js_code = 'console.log(' . json_encode($output, JSON_HEX_TAG) .
');';
if ($with_script_tags) {
$js_code = '<script>' . $js_code . '</script>';
}
echo $js_code;
}
Also in PHP:
- explain date function in php
- execute script php command line
- date +1 day
- create folder if not exist php
- date en cours php
- '%r%i timeformat php
- check whrew key in array have a value
- doctrine fixture bundle
- close connection pdo
- encode decode in php
- clear cache route laravel
- convert string to uppercase in php
- FORCE CAPS LOCK PHP
- find length of string php
- alphabet and numeric random php
- assoc key unique php
- delete cache laravel
- In Connection.php line 1262: Class 'PDO' not found
- exception get short message php
- factoring and seeding in laravel
- composer install larave
- check a string contains a ltter in php
- carbon add minutes
- add date days php