Read Text File using PHP

Posted on: 25/08/2022
140644 views, 0 comments

Although we have database to work with data, with some circumstances we still need to work directly with files, especially text files. Here in this tutorial, you will know how to read a text file using PHP with a few different functions including fgets()file(), and file_get_contents().

Facebook New Feed Animating Pre-loader

Posted on: 30/11/2014
130258 views, 0 comments

Pre-loading technique is very convenient for users when the system needs some times to retrieve data from the server. It makes the user understand that the server is still busy or need some times to get the data. The technique is commonly used with Ajax request dealing with database to load new data and to refresh a specific content or block. In this tutorial, we will share about the pre-loading technique used by Facebook web application. When we talk about Facebook, you will notice about something we usually see when scrolling down the page and when we refresh its page. Its new feed/content loads using a pre-loading technique to inform its users that the feeds or text content is still loading and wait until it finish its loading. Some of you may also think Facebook may use image with GIF type for displaying that animated pre-loader. In fact, that’s not! There is a trick you should know because it’s very nice and easy. Let’s see how to make it works without GIF image!

Dynamic Exporting to Excel by phpExcel and Ajax

Posted on: 08/08/2014
163222 views, 0 comments

It is very common to have the list exportable to save the data from the database to local machine. Doing this with online web list data is not that hard. We would like to recommend using phpExcel to get this work done. However, this tutorial not only introduce that library but also introduce how to using that library dynamically meaning that create your own library to work with the existing library. What does using that library dynamically really mean? To answer this question, let’s suppose there are 4 table lists in our website with different data like customerinfo, customerlog, songlist, and newslist. Therefore, using that library dynamically means having a standard php file containing our own library and be able to be used for all data list type by just identifying the list type.

MySQL UTF8 Connection Using PHP

Posted on: 19/07/2014
131046 views, 0 comments
Are you finding a way to get your utf8 characters displayed in your website content?

Actually, there are many languages that use uft8 characters while some others use the alphabet/Latin characters. This PHP function will help you to query your utf8 database contents to your website.

However, there are two functions you can see here: standard query named exec_query() and utf8 query named exec_query_utf8().

Detect Input Data Changed by jQuery

Posted on: 10/07/2014
129407 views, 0 comments
This is the technique to check our data input whether they are changed or not before sending them to the database via ajax.

This function will help you to save your ajax request time if there is nothing changed in your data input. So, when you did not change anything in your form input, this function will check and return you back an value (true/false). In this case, if you can stop your ajax requesting to update the exactly the same data to your database.

For more detail, please see the bellow instruction.