After another PHP recompilation I’ve started getting the following error while trying to access SSL websites with cURL: 56 SSL read: error:140940E5:SSL routines:SSL3_READ_BYTES:ssl handshake failure, errno 0 What does this mean and how to solve this issue? This means your cURL installation is trying to use the wrong number of SSL protocol. All you need to resolve this… Read More »
If you have an array with duplicate values, sometimes you might need to show only non-unique elements. Here is a short code in PHP that will allow you to do this. <? $arr=array_map(“trim”, file(“file.txt”)); $nonuniq=array_unique(array_diff_assoc($arr, array_unique($arr))); ?> This will return unique array of duplicates. If you need to show all duplicated values, use this code. <? $arr=array_map(“trim”, file(“file.txt”));… Read More »
Just wanted to paste a PHP solution for a Paypal refund. It was found on Paypal official site, but I spent some time to get it.
You can count the number of substring occurrences using Regexp-based functions, but if you don’t want to deal with them, that seems to be the fastest option for case insensitive substr_count.
Today I had to fix a script that sends an e-mail using PHPMailer. Here is the intital code: I had to send 2 different mails: one to the buyer and another one to administrator. If I tried to send another mail by using the same code, I got 2 recipients for e-mail. I’ve searched for the way in… Read More »
Since cookies are small files that are stored on user computers, you don’t have the ability to remove them as files. But you can delete them using a simple PHP script.
Recently I had to deal with Twitter avatar upload for a Twitter application. Everything went very well, but when I have prepared everything for the upload query, the only server response I got was Error 417. Since I used cURL, I tried to deal with different headers, but with no luck at all. I found the solution at… Read More »
If you need to work with Russian text in PHP, you may notice that functions that are related to CaSe are not working as expected. I mean strtolower, strtouper, ucwords, and so on. In order to get what you need I suggest to use mb_convert functions. Here is the example: You can check reference table for functions, I… Read More »
Just found one useful function and would kike to share it. If you often use strpos, you might find this useful. This function will be useful if you need to find whether ANY element of array is presented in the source string. Else you have to either modify it, or create another one.
php auto prepend using httpd.conf