Tag Archives: PHP

Checking Mime-Type of External URL Using PHP

I was overwhelmed by Mime-Type while I was working for a project. The problem is I don’t know how to retrieve the mime-type from a file, particularly file from another host. This url is the one I want t check its mime-type. Why do I have to check it? Because it doesn’t have proper extension […]

Returning Filename Only in PHP

How to strip file extension in PHP? I want to lose my filepath in my PHP string and then leave the filename without extension for the rest of it. I want to eliminate the darn extension! It’s very easy my friend. It’s basic, but it took me an hour to find the best solution. The […]

PHP Example: preg_match() USA Telephone Number Matching

I’ve practiced about how to match USA telephone number format in different format using preg_match() function. The first time I found the exercise is in the Learning PHP 5 by David Sklar. In B8 exercise we have to write PHP script: regular expression that flexibly matches a U.S. phone number whether or not it has […]

How to Put Date from MySQL to Select HTML Tag with PHP

You may want to create editable data using PHP and HTML. You want to take your date type value to your <select> HTML tag. It is not difficult, but yes we need to be patient to code it. First, you should call a query to your MySQL such as: Second, you have to set the […]

How to Store Date from Select HTML Tag to MySQL

Storing a date from <select> HTML tag to MySQL database is not that easy. I spent three hours to find out how. First time I tried to, I was thinking that my script was not effective. But, after reading some tutorial I found my own way to do it. Here it is. MySQL script Put […]

How to Add CURL to your PHP in Ubuntu

It is very easy about installing CURL to your PHP5 in Ubuntu 10.10 just straight do this in your Terminal. sudo apt-get install curl libcurl3 libcurl3-dev php5-curl php5-mcrypt Restart your Apache Server /etc/init.d/apache2 restart OR sudo /etc/init.d/apache2 restart Welldone! And special thanks to Ivan Kristianto

How to Install Apache and PHP 5 on Ubuntu

I found this site when I search the way to install Apache as webserver and PHP5 on my Ubuntu 10.10. sudo apt-get install apache2 sudo apt-get install php5 sudo apt-get install libapache2-mod-php5 sudo /etc/init.d/apache2 restart One said that you don’t need to run sudo apt-get install libapache2-mod-php5 command because it is done with sudo apt-getinstall […]