check file types of uploaded files in PHP
Problem And Question On the PHP website, the only real checking they suggest is using is_uploaded_file() or move_uploaded_file(), here. Of course you usually don’t want user’s uploading any type of...
View Articlecreate cron job using PHP
Problem And Question I’m new to using cron job. I don’t even how to write it. I have tried to search from internet, but i still don’t understand it well. I want to create a cron job that will execute...
View Articleuse open id as login system
Problem And Question I want to try to use open id as login system on the site that I am going to make. I’ve check out this site, and I’m not pretty sure how this all works and how to make it work....
View ArticleWhat’s deal with leading underscore in PHP class methods
Problem And Question While looking over various PHP libraries I’ve noticed that a lot of people choose to prefix some class methods with a single underscore, such as public function _foo() …instead of…...
View Articleread any request header in PHP
Problem And Question How should I read any header in PHP? For example the custom header: X-Requested-With. Best Solution And Answer Simple method (Works only with apache and, as of PHP 5.4, for...
View Articlewrite file in UTF-8 format
Problem And Question I have bunch of files that are not in UTF-8 encoding and I’m converting a site to UTF-8 encoding. I’m using simple script for files that I want to save in utf-8, but the files are...
View ArticleFactory Design Pattern in PHP
Problem And Question This confuses me, in the most simplest terms what does it do? Pretend you are explaining to your mother or someone almost please. Best Solution And Answer A factory creates an...
View Articleget current time zone of MySQL
Problem And Question Anyone knows if there is such a function in MySQL? UPDATE This doesn’t output any valid info: mysql> SELECT @@global.time_zone, @@session.time_zone;...
View Articleremove html special chars
Problem And Question I am creating a RSS feed file for my application in which I want to remove HTML tags, which is done by strip_tags. But strip_tags is not removing HTML special code chars:...
View ArticleI have array of integers, how do I use each one in mysql query (in php)
Problem And Question I have an array full of random content item ids. I need to run a mysql query (id in the array goes in the WHERE clause), using each ID that’s in the array, in the order that they...
View Article