PHP

Home » PHP (1586)

Calculating Yesterday's Date
Calculating or retrieving yesterday’s date in PHP: I came up with 4 quick ways to calculate it.

I always remember method 1, using mktime() but decided to benchmark each of them to see which method of calculation is the most efficient.

I used date("Y-m-d") as a control in all the benchmarks since each of the yesterday calculations are using that function to display.

Get All Wordpress Navigation Menus
If you are creating a custom themes options page or a WordPress plugin which needs to get all the WordPress menus in your site. This small function can be very useful, it will return all the WordPress menus on your site in an array so you can process them as you want.

Read Word and PDF files
In most of the big web applications we will have to deal more or less with file manipulations. Sometimes we need to create some config files, create PDF files for generating reports or reading XML feed and parsing data. Since most of the servers that host PHP are Linux based, real question here will be, how we can read Windows files, for example .doc or .docx files created in Word or PDF file in order to retrieve data from given files?

Display Top Commenters On Wordpress Blog
There are many blogs that like to reward the top commenters on their blog by displaying who they are on the sidebar. Another common approach is to display the most recent commenter.

How to create a small Drupal Module in 10 minutes
This tutorial will show you the basics about creating your first Module for Drupal.

How To Setup A Localhost
n this latest tutorial I will be teaching you how to quickly and easily setup a localhost. What I mean by localhost is a fully capable web server for you to test your scripts on while programming thus allowing you to edit the code live instead of uploading every time you make a change.

Run Shell Commands in PHP Script
In this tutorial I will be demonstrating how to run shell commands using PHP. This means you could run commands on the web server for example PING, WGET, etc. There are a couple different commands that will allow you to accomplish this some having different results, but for the purpose of this guide I will be using the shell_exec() function.

Password encryption
In today's post I will be showing you how to encrypt passwords using PHP. I will try to keep the examples as simple as possible allowing you to see whats happening as we encrypt and salt our password.

SQL & PHP mass settings update, auto form generation
This time, I'll show you how you can easily generate a settings table with an update button. This only takes a few lines of code! I've used this in one of my own scripts, it's very easy once you've figured it out.

Creating a setup locker
In order to keep a setup secure, it should be locked after installation, so that nobody can overwrite the current installation. Doing so is actually more than easy if you know how to handle file opening and writing in PHP. Checking if it's locked however, is more than easy and anybody could do so.

Basic functioning of forms
How do forms work and how do you get information from a form safely? What are the available methods for parsing forms? That's what we're going to discuss in this tutorial.

Taking care of logins
I'm posting a small but useful tutorial if you didn't think about it. A programmer needs to learn to think out of the box.

Must Have WordPress Plugins and Tools
Using WordPress alone limits the user to just plain blogging. So I've listed down some of the plugins every WordPress site should have. Use this to extend the functionality of WordPress. I've listed 9 of them below. In case some of them does not work on your current site due to compatibility issues from upgrades in WordPress core or other plugins, you can always search for an alternative with the same functionality.

PHP and MySQL Communication Class
MySQL and PHP are a very common combination, especially with large scale websites, or websites with frequently updated content. So if you're going to creating a website, its best that you manage your PHP and MySQL relationship well. In this tutorial we will look at making a class that we can use to manage all of our connections and queries to our MySQL Database.

Install PHP on Windows os
You must have a web server up and running on your Windows system, else you will not be able to run PHP Scripts.
Alternatively you can install wamp server to install PHP, MySQL, and Apache Web Server on your Windows machine.

PHP variables / Declaring variables
Variable is a symbol or name that stands for a value. Variables are used for storing values such as numeric values, characters, character strings, or memory addresses so that they can be used in any part of the program.

Tags and Syntax
There are four different pairs of opening and closing tags which can be used in php.

PHP var_dump() function
The var_dump() function is used to displays structured information (type and value) about one or more variables.

date() function
This tutorial explain the PHP date() function, it displays a formatted local time and date.

Using PHP - Random Password Generating
If you are creating a user management system, password are a must. You may want to generate random passwords for users the first time they register. Well, this tutorial will guide you on how to make a random password generator.

Home » PHP (1586)