Quantcast
Channel: » PHP Script
Browsing all 19 articles
Browse latest View live

Date/time to MySQL and UNIX timestamp conversion using PHP

Below steps will describe how to convert date/time to mysql and unix timestamp using PHP. Step 1 : Some people have problems with the conversion from a date posted by a form and into a format for later...

View Article



How to use Regular Expression in PHP

PHP has a great interface to regex with using the preg functions. These functions expect the regex patterns you feed them to be framed by one delimiter character on each side. For instance, if you...

View Article

PHP FILTER_VAR – Your new best friend

filter_var(variable, filter, options) variable : Required. Specifies the variable to filter filter : Optional. Specifies the ID of the filter to use. Default is FILTER_SANITIZE_STRING. Check the...

View Article

How PHP gmdate() function will work

Following function is similar in nearly all respects to date() . It displays a date in a format specified in the first argument, except that the date string is calculated to be displayed in GMT....

View Article

Location detection using PHP Script

The Geo location API is used to get the geographical position of a user. Since this can compromise user privacy, the position is not available unless the user approves it. Use the getCurrentPosition()...

View Article


Pattern Matching using ereg() in PHP

Definition and Usage The ereg() function searches a string specified by string for a string specified by pattern, returning true if the pattern is found, and false otherwise. The search is case...

View Article

How to Measure PHP page load time

Using microtime() PHP function you will know exactly how much time is needed for your PHP code to be executed. Follow the steps below to put the PHP code on your web page: The following code has to be...

View Article

Simple calculator script using PHP

Kindly follow below steps to create simple calculator script in PHP. Step 1 : calculate_forum.html Value 1: Value 2: Calculation: add subtract multiply divide Step 2 : calculate.php View Code PHP1...

View Article


Convert Temperature using PHP

Kindly find the code for Convert Temperature using PHP. Temperature Conversion Degrees: Celsius Fahrenheit Kelvin Rankine View Code PHP1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 … The...

View Article


Sanitizing variables to avoid xss cross site scripting using php

Once of the biggest considerations when hosting a website is security, this applies to both hosting your own website and also hosting your web site with a hosting company. One of the biggest headaches...

View Article

An alternative to ORDER BY RAND() for MySQL

The issue with RAND() is it will be inefficient on large tables because each row needs to have the random number calculated before the resultset can be ordered. This post looks at an alternative which...

View Article

Analyzing URLs as Links to the resource using a PHP function

This is PHP function split_url_fuction() writter for twitter like application useful to split URL from the updated sentence(posted message), then URL changing like tinyurl and link to the resource....

View Article

Jquery Timeago Implementation with PHP

Nowadays timeago is the most important functionality in social networking sites, it helps to updating timestamps automatically. In this post I am just presenting a simple tip to implement timeago in a...

View Article


Date function in PHP

Date() : Returns a string formatted according to the given format string using the given integer timestamp or the current time if no timestamp is given. In other words, timestamp is optional and...

View Article

How to use iterative function in PHP

Using PHP, we can have iterative function like array_walk and we can use this function as following. array_walk — It’s a user function to every member of an array Syntax : bool array_walk ( array ,...

View Article


Memory allocation using in PHP

In PHP there are many ways to allocate the memory but using the function memory_get_usage(), we can allocate the memory to the string as follows. memory_get_usage — Returns the amount of memory...

View Article

PHP Script that uses Cookie for login

Following html and PHP files contains the PHP login script that uses cookie for login: > Please Specify the Password Customer ID Password CookieBasedLogin.php View Code PHP1 2 3 4 5 6 7 8 9 10 11 12...

View Article


Design pattern(Factory Method) in PHP

Design Patterns There are numerous ways to structure the code and project for you web application, and you can put as much or as little thought as you like into architecting. But it is usually a good...

View Article

Adding Bookmarks the AJAX Way

Please find following code for adding bookmarks the ajax way here. Here are the scripts: THE AJAX.JS FILE View Code PHP1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 … The post Adding Bookmarks the...

View Article
Browsing all 19 articles
Browse latest View live




Latest Images