Archive | PHP

RSS feed for this section

PHP function ord of unicode character

Read more: PHP function chr of unicode character We have 6 methods: Example: echo uniord(“♥”); //9829 echo “”; echo uniord2(“❤”); //10084 echo “”; echo uniord3(“❥”); //10085 echo “”; echo uniord4(“❦”); //10086 echo “”; echo uniord5(“❧”); //10087 echo “”; echo uniord6(“❧”); //10087

Read full story Comments { 0 }

simplest Hash algorithm PHP

Example: Result:

Read full story Comments { 0 }

PHP function pack in Javascript

Example: Result: Try it yourself

Read full story Comments { 0 }

PHP function str_split in Javascript

PHP function str_split in Javascript (method of locutus.io) Method of locutus.io can work with ASCII string, but with non-ASCII string (like UTF8 string), this doesn’t work successfully! Example: Result: But result in PHP: We can use the method in this artice: Javascript: read ASCII characters from Unicode string, now we write own method: Try it […]

Read full story Comments { 0 }

PHP unpack function in Javascript

The method based on locutus.io: Example: Result: Try it yourself

Read full story Comments { 0 }

PHP: how to save a remote file using CURL

How to save a remote file using CURL? You can read more about CURLOPT_WRITEFUNCTION in this article: PHP: Example of usage CURLOPT_WRITEFUNCTION

Read full story Comments { 0 }

PHP: upload file to FTP server

How to upload file to FTP server using PHP?

Read full story Comments { 0 }

PHP: How to check if a remote file exists

Main method is read header file, so, you can read 2 article first: PHP: How to get size of a remote file PHP: How to get size of a remote file – Part 2 Here, we give some methods: Method 1: Example: Result:

Read full story Comments { 0 }

Linux: Cron job to monitor for php-fpm service problem

Sometimes, php-fpm service is error, how to monitor for php-fpm service ? Step 1: create a file like check.php with a simple content like and upoad this file to document root (like: /home/vpssim.demo/public_html), you will have the link: http://localhost/check.php Step 2: add a cron job: You can use the command line Then type: i Then […]

Read full story Comments { 0 }

PHP array_shift equivalent in golang

We use reflect as the example: Result:

Read full story Comments { 0 }