Today I had to put a simple script on one of my hosting server where a “Facebook Login” button was available for login. However when I had to run it I encountered the following error: Warning: file_get_contents() [function.file-get-contents]: Unable to find the wrapper “https” – did you forget to enable it when you configured PHP? [...]
Along with the “upload_max_filesize” when uploading files with PHP there is another parameter named “max_file_uploads” witch prevent uploading more files that the value of this parameter. Default size of this parameter is 20 and is should be enough for more apps then I can count but today I had to repair a bug in a [...]
When you let users input text in a textfield or input box iti is always a good ideea to use trim function to remove spaces form the begining or the end of the string. Today I needed a function to trim spaces from the middle of a string and replace with a single space. /* [...]
This 3 lines will give you the current date minus 1 hour: $date = date("d-m-Y H:i"); $newdate = strtotime ( ‘-1 hour’ , strtotime ( $date ) ) ; $newdateStr = date (‘d-m-Y H:i’ , $newdate );
Sometimes when debugging an application you need to see all global variables. In PHP there is an easy way: $defined_vars = get_defined_vars(); print_r($defined_vars);
Printing a new line witch is visible in a web page is made like this: echo(‘line 1′.‘\n‘.‘line 2′); the code above will print line 1 on a line and line 2 on a new line. Now if you have to generate a CSV file <br/> wil not work you have to use \n like [...]
Browsing phpclasses.org I had found a very interesting article Neural Networks in PHP . For anyone who dont know yet “Neural networks allow emulating the behavior of a human brain in software applications.” In this article you can read how to implement Neural Mesh to develop Neural Network applications in PHP. (Neural Networks in PHP) [...]
When you insert or update a date in a mysql Table you have to remember that Mysql have 3 types of date DATETIME ( default format 0000-00-00 00:00:00 ) DATE ( default format 0000-00-00 ) TIMESTAMP ( default format 0000-00-00 00:00:00 ) PHP code: DATE -> $mysqldate = date( ‘Y-m-d’ ); DATETIME, TSTAMP [...]