Search
 
SCRIPT & CODE EXAMPLE
 

PHP

log data into file 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);
Comment

PREVIOUS NEXT
Code Example
Php :: why pusher not working in laravel 
Php :: laravel try catch example 
Php :: Str laravel 9 
Php :: laravel unique multiple columns 
Php :: php ob_start 
Php :: php required 
Php :: get country from ip address 
Php :: delete multiple row in laravel 
Php :: laravel get all session data 
Php :: using php, how to create a folder in another folder 
Php :: search post by post title in wordpres 
Php :: ternary operator in php 
Php :: laravel launch only one dusk test 
Php :: menampilkan hari dan tanggal sekarang di php 
Php :: Pass all data to all pages laravel 
Php :: current time input field in laravel form 
Php :: how to make-migrations in laravel 
Php :: acf get field 
Php :: php checking if array is multidimensional or not 
Php :: php utc time 
Php :: validator and custom error laravel 8 
Php :: php catch all exceptions 
Php :: laravel unique column except self 
Php :: migrate specific migration file laravel 
Php :: php get filetype 
Php :: transform text to lowercase and replace space with dash php 
Php :: collapse open by default 
Php :: migration laravel 
Php :: taxonomy_get_children drupal 8 
Php :: laravel rename table 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =