PHP write string data to a file -


how can write data file php?

here example of needs written:

    $filename = 'test.txt';     $keysize = '2048';     $dname = 'www.domain.com'; 

the end result of test.txt file should this

[ req ] bits = 2048 domain_name = www.domain.com 

use file_put_contents

$output = "[ req ] \nbits = $keysize\ndomain_name = $dname"; file_put_contents($filename, $output); 

\n makes new line. can put $keysize etc in string because i'm using " make string - not work '. see relevant question: what difference between single-quoted , double-quoted strings in php?


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -