HOME PHP HTML Python CentOS Web Development DNS IPv6 today IPv4 Networking email validation yepp REST timeout mysql mysqld metaWeblog API file attachment Amazon S3 S3 Socket Programming GD Library Programming URLDecode Internet Protocols REMOTE_ADDR File Delete Function extract_filename Similarity javascript calendar JSON json_decode json_encode AUTO_INCREMENT Knuth Redirection PHP.INI mt_rand XHTML Implementing a Versatile DNS Server in Python: Handling A Force Cookie Apache and TXT Records IXMLDOMDocument KMP Algorithm AAAA Application Version header GD-Library zip blog body Browser echo Dynamic-Image DNS Protocol diff dictionary Data Import CPU copy & paste

PHP ( 1 / 3 )

Mastering Excel Data Importation in PHP   (created at Apr 24, 2024)   35  

You may use an Excel spreadsheet to manage your data for many cases, and had some chances that you want to use it as a direct data source from time to time.You can use PHP libraries like PHPExcel or PhpSpreadsheet to handle Excel files with multiple sheets...

JSON format control in PHP   (created at Sep 13, 2012)   163  

PHP provides an easy way to handle JSON format, whether you're creating or parsing it. Let's delve into how to do both.Creating JSON format in PHP is straightforward. You can use arrays and the json_encode() function to convert PHP data into a JSON string....

Checking similarity between two strings in PHP   (created at Jun 16, 2013)   110  

PHP includes a function similar_text() very rarely used but quite useful that compare two strings and returns the percentage of similarity of between two. 

Create Blob Image in HTML based on the given Text, Width and Height in the Center of the Image without saving file   (created at Apr 21, 2024)   86  

Creating images dynamically within HTML can be a powerful tool for web developers, allowing for personalized and customizable content. By leveraging PHP's GD library, developers can generate images on-the-fly based on user input or other dynamic data, with...

How do I determine the client IP type (IPv4/IPv6) in PHP   (updated at Apr 16, 2024)   123  

In the PHP, there are filters which can determine IPv4 and IPv6: FILTER_VALIDATE_IP, FILTER_FLAG_IPV4, FILTER_FLAG_IPV6.Below code shows how to determine the client protocol:This code snippet checks whether the client's IP address is IPv4 or IPv6 using fil...

What is 302 Found Redirection in HTTP 1.1?   (created at Apr 04, 2024)   119  

In PHP, you can implement a 302 Found redirection using the header() function to send the appropriate HTTP headers. Here's an example of how you can use it:In this example:The $newLocation variable stores the URL to which you want to redirect.The header() ...

How to force cookies, disable php sessid in URL ?   (created at Oct 15, 2007)   139  

This commands disables php from rewriting URLs to add a phpsessid, and forces the use of cookie sessions instead. Using cookies is largely thought of as the preferred way to use sessions - both more secure and better for SEO. This can be accomplished by se...

Implementing a Versatile DNS Server in PHP: Handling A, AAAA, CNAME, and TXT Records   (created at Mar 16, 2024)   107  

Supporting AAAA records, which are used for IPv6 addresses, is a straightforward extension of the previous examples. The AAAA record type is essential for modern applications that operate over IPv6 networks.Here's how you can modify the existing PHP DNS se...

Building a Basic DNS Server in PHP/Python: A Beginner's Guide   (created at Mar 15, 2024)   145  

Creating a full-fledged DNS server in PHP is not recommended for production environments due to performance and security concerns. DNS servers require low-level networking capabilities and efficient handling of DNS protocol messages, which PHP is not optim...

Uploading files to Amazon S3 with REST API in PHP   (created at Sep 27, 2010)   342  

You can upload files with socket based REST API in PHP. In order to access Amazon S3 API, you need Access Key and Secret Key. Following is the example.   

GD library version in PHP   (created at Sep 25, 2012)   192  

In case that you need to know the version of GD library, you can use below function in PHP.

mcrypt missing when using phpMyAdmin on Centos 6.7   (created at Nov 02, 2015)   173  

“mcrypt” is an interface to the mcrypt library, which supports a wide variety of block algorithms such as DES, TripleDES, Blowfish (default), 3-WAY, SAFER-SK64, SAFER-SK128, TWOFISH, TEA, RC2 and GOST in CBC, OFB, CFB and ECB cipher modes. Additionally, it...

Simple PHP code performance measuring example   (created at May 19, 2013)   328  

Below code is the simple reference to measure code execution time. Sometimes, you may need to check Performance for optimization to reduce server cost.

How to set AUTO_INCREMENT ID in mySQL ?   (created at Jul 01, 2011)   132  

In case that you need to set AUTO_INCREMENT ID manually, you can set it as below: 

Convert plain HTML to XHTML   (created at Mar 04, 2013)   115  

Below is the example of converting from plain HTML to XHTML.

Image file resizing in PHP   (updated at Dec 17, 2023)   181  

Below example shows how to resize image in half size. Actually imagecopyresized() do the necessary things.

File downloading function through PHP code   (created at May 29, 2012)   147  

Sometimes, you may need to implement download function for access control to avoid illegal connection. Refer below reference code.

Function can extract file name in string having full path in PHP   (created at Jun 18, 2011)   157  

Sometimes, I make string operation function regarding file operation. Actually extracting file name only is frequently using function in terms of my point of view. But one thing if you do the same thing like me, please use below function already provided b...

How to create private URL on S3/CloudFront with time-limit ?   (created at May 26, 2011)   154  

For security reason, many companies may require one time temporary or private URL with time-limit. Some people call this as private or signed URL. Below URL is based on PHP and contains S3 signed URL generation function and CloudFront signed URL generation...

Apache server unstable detection and the related server(mysql, apache) restart automatically   (created at Mar 19, 2012)   138  

I am using CentOS with php, and mysql for web service, and sometimes my server is dead by unknown reason so I optimize mysql database and restart web server manually. Following is the first my /etc/cron.hourly/optimze process for seamless service. But...

PHP Code can know the current OS is windows or not   (created at Feb 20, 2014)   104  

Below PHP code is for knowing the current OS working is Microsoft Windows or not. I have used below example code to call COM object in case that the OS is Microsoft Windows.

Setup Apache+PHP+MySQL on Centos 6.7   (created at Nov 02, 2015)   146  

If you installed Centos in minial installation mode, you should install Apache + PHP + MySQL manually.The followings are the procedure to install Apache + PHP + MySQL:Making apache and mysql to start automatically

Simple PHP calendar   (created at Jun 02, 2013)   109  

Below is the simple PHP calendar generation function.

mysql optimization – if you are using Word Press, do not turn off persistent connection   (created at Jun 12, 2012)   134  

I am using Virtual Private Hosting service, and I found that my server has some problem as below. As you can see the CPU occupation rate is more than 300%. So my server response speed is the most slower than I had experiences before. I had read some articl...
mysql optimization – if you are using Word Press, do not turn off persistent connection

Parsing XML in PHP   (created at Mar 06, 2011)   120  

To parse XML easily in PHP, I recommend you to use SimpleXML extension. The below is the sample reference to use SimpleXML extension.    

Unzip a ZIP file in PHP   (created at Oct 24, 2010)   56  


Human readable random string for captchas in PHP   (created at Jul 05, 2010)   100  

The below function will generate a human readable string that will look more cose to dictionary words, and this will be useful for captchas.

How to get browser information in PHP?   (created at Jun 22, 2010)   94  

PHP provides to get browser information by function. Below is the simple example.Above example may display as following, if you use FireFox.Mozilla/5.0 (Windows; U; Windows NT 5.1; ko; rv:1.9.2.3) Gecko/201004...

How to get the duration between days in PHP   (created at Jun 15, 2010)   84  

Following is the funcation can calculate the duration, actually number of days between the given parameters (from,to). The argument must be subclass of DateTime.  

Date format validation in PHP   (created at Nov 28, 2009)   57  

Below code is designed for date format validation in PHP. Even though simple, but useful many times. Actually PHP provides date validation function as checkdate(). See the detail below.  


Page: 1   2   3