php

I like php’s file_put_content function, which can write a string to a file with single line of code: file_put_content(“file.txt”,”content”); Few languages have such powerful function. In C language, you need […]

I have a project in which I need to convert a byte into an integer: <?php $a=md5(“hello”,true); echo $a[15]*1.0/255.0; The second parameter of md5 is set to true in order […]

I often got confused about JSON and JSON string. JSON is the code you write in your javascript script to represent an object, so the code is called JavaScript Object […]

I encountered a strange problem of php curl. I use curl to fetch a remote web page as follows: $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, “https://myprogrammingnotes.com”); curl_setopt($curl, CURLOPT_HEADER,1); curl_setopt($curl, CURLOPT_FRESH_CONNECT,1); curl_setopt($curl, […]