Php

PHP: Basic Introduction to Namespaces

History of PHP Namespaces In PHP prior to 5.3 (2009), any class you define lived at the same global level as other classes. Class User, class Contact, class Db they're all together in the global namespace. This may seem simple, but it makes organization tough, which is why PHP developers started using underscores…

Category : Php   19-05-2017  

Php: How to extend the highlight_string function

PHP has a cool function that automatically highlights PHP code called highlight_string(); Theoretically this could be used to roll your own code highlighting on a site, rather than rely on JavaScript or some kind of external service to do it. In this article I'll show you the basics of how…

Category : Php   11-02-2017  

PHP Libraries For Summer 2016

Here are our picks for the 12 most useful and interesting open-source PHP libraries that you should check out this summer!   Monolog With Monolog you can create advanced logging systems by sending your PHP logs to files, sockets, databases, inboxes or other web services. The library has over 50 handlers for various…

Category : Php   11-08-2016  

PHP7: Guide and References to all the changes between version 5.x and 7 of PHP

PHP 7 was released on December 3rd, 2015. It comes with a number of new features, changes, and backwards compatibility breakages that are outlined below. Performance Features Combined Comparison Operator Null Coalesce Operator Scalar Type Declarations Return Type Declarations Anonymous Classes Unicode Codepoint Escape Syntax Closure call() Method Filtered unserialize() IntlChar Class Expectations Group use Declarations Generator Return Expressions Generator Delegation Integer Division with intdiv() session_start() Options preg_replace_callback_array() Function CSPRNG Functions Support…

Category : Php   27-12-2015  

Php: Create your Caching System Easily and Quickly

If you need to integrate a caching system quickly, you can use this ultra simple file caching method to cache any kind of dynamic data. Usually, if you’re doing API calls or using PHP to pull data from another server it’s always good to implement some kind of caching layer.   $exists…

Category : Php   12-11-2015  

Easy debug of Php with ChromePhp and ChromeLogger

ChromePhp is a Module to log useful details directly in your Chrome JS console. You can inspect most as objects and see infos or values. It is a great way to debug PHP code on the fly, in Google Chrome. It's very easy to integrate to any project and log any…

Category : Php   29-10-2015  

PHP Filters: the best way to sanitize and validate datas

What are PHP filters? One of the most amazing strengths of PHP is its convenience. Shockingly this same profit has worked against PHP as numerous new coders have forgotten any security to establish safety or fails to offer the adroitness to make a class to validate their variables from end users. One…

Category : Php   28-08-2014  

10 Useful PHP Image Manipulation Libraries

In this article, we listed 10 PHP Image Manipulation Libraries which help developers making their tasks simpler.   1. Imagine   Imagine is a OOP library for image manipulation built in PHP 5.3 using the latest best practices and thoughtful design that should allow for decoupled and unit-testable code. In order to produce RGB code…

Category : Php   09-06-2014  

PHP: list of best awesome PHP libraries

It is an exciting time to be a PHP developer. There are lots of useful libraries released every day, and with the help of Composer and Github, they are easy to discover and use. Here is a complete list of the coolest that We’ve come across. Package Management Libraries for package and…

Category : Php   27-04-2014  

How to implement a PHP session timeout on your own

To Implement a session timeout on your own,  you can use a simple time stamp that denotes the time of the last activity and update it with every request. You can also use an additional time stamp to regenerate the session ID periodically to avoid attacks on sessions. Enjoy the code! if (isset($_SESSION)…

Category : Php   05-12-2013  

Hash Passwords With PHP 5.5

Every PHP developer would have to build an application that relies on a user login. It means that the user of the website having a Username and Password which is stored in the database so they can login into your website. Therefore it's important that passwords stored in the database should be hashed…

Category : Php   28-08-2013  

How to Store HTML View File In A Variable

If you are familiar with th MVC language before you certainly know the practice of separating your business logic from your HTML. The way this works in MVC language is that the framework will allow you to assign a view (HTML) to a controller (class). In this tutorial we are going to…

Category : Php   26-08-2013  

PHP: Sort array alphabetically using a string/value in subarray

If we have an array and inside each value of this array we have another array with age and name for example, and we want to sort the first array by the name of each value in the child arrays we do is using usort  and strcmp functions from php. Here…

Category : Php   23-08-2013  

10 Best PHP Scripts for Polling System

In this post we will show you a collection of 10 best PHP Poll Scripts. These PHP scripts for polling system can be added in any self-hosted website. Check out these awesome and easy to install scripts. 1. JAXpoll   JAXpoll is a polling widget that you can add into any of your websites.…

Category : Php   23-08-2013  

PHP: Getting started with Object Oriented Programming in PHP5

This is a tutorial covers some main concepts of OOP in PHP5 with usable examples (however useless the something may be). The tutorial only covering a few fundamental subjects, all subjects are complete in and of themselves. What is OOP? Object Oriented Programming, referred to as OOP is a way to efficiently…

Category : Php   12-08-2013  

17 Useful Code Snippets for WordPress Developers

When coding WordPress themes, especially if you do it regularly, its really useful to have a selection of code snippets in your toolbox to just 'copy-n-paste' as and when the functionality needs. Not just your most commonly used code, but also some snippets that can, when required, extend WP even…

Category : Php   09-08-2013  

SEO from Php with PhpSEO class in PHP

  Here we present a class to make better SEO in your PHP. I want to post about SEO functions and classes for PHP and this is my first post about it. Let me show a demonstration of PhpSEO. Basic usage: $seo = new phpSEO("some long text here"); $keywords = $seo->getKeyWords(); $desc = $seo->getMetaDescription(); Advance usage: $seo =…

Category : Php   29-05-2013  

Learn PHP: Handy Functions for Beginners

If you’re new to PHP language, we’ll introduce you to seven really handy PHP functions in this quick tip! Function 1 : isset Check if a variable has been set. You just pass it a variable name, and it will return true if that variable exists, and is set to something other than NULL. $name = "Joe";    isset($name); // true   isset($age); // false   This function also…

Category : Php   11-04-2013  

12 Tutorials for creating PHP5 MVC Framework

Here we listed  a set of thirteen good resources to help you get started and introduce you to some of the basic framework concepts. 1. PHP MVC Framework 2. PHP5 Framework 3. Your Own PHP Framework 4. Within An Hour PHP MVC Framework 5. Lightweight PHP MVC Framework 6. Learn To Build Your Own PHP Framework 7.…

Category : Php   11-04-2013  

PHP: Convert coordinates from degrees to decimal format

  This code will convert longitude and latitude in D'M'S format into a decimal format. It also contains the function to do the reverse. The example below does contain a couple of strange lines of code. You will notice that we seperate the integer and floating point values from the decimal format…

Category : Php   11-04-2013  

PHP:EZSql class, manage your database connection easily

EZSql is a php class to make it very easy to deal with database connections, there’s already an ezsql documentation: Extensive ezsql documentation Requirements Wampserver ezsql library Installation First you need to download wampserver and ezsql library. I’ve already included the links in the requirements section. Next, setup your test folder. Then create your database configuration file…

Category : Php   11-04-2013  

Php Snippet: parse url and separate all it's parts

Use this snippet to get some value iside urls, for example the last directory. $url = 'https://aplicaciones.org/wp-content/uploads/2011/09/skypevideo-500x361.jpg?arg=value#anchor'; print_r(parse_url($url)); $url_path = parse_url($url, PHP_URL_PATH); $parts = explode('/', $url_path); $last = end($parts); echo $last;

Category : Php   11-04-2013  

Tips to Create Secure PHP Applications

PHP is one of the most popular programming languages for the web. Such languages are very helpful for the programmer but the security holes in it can create a problem. They can create problems in the development path.Below are few tips to help you avoid some common PHP security pitfalls…

Category : Php   11-04-2013  

Learning Loops in Php: FOREACH

Loops come in several different flavors in PHP: for, while, do-while, and foreach. We will introduce you to each of them in 3 lessons and we will show you how they can making repetitive tasks straightforward and easy to maintain.   Lesson #3: The foreach Loop To understand FOREACH loops you have to know the arrays. When using a loop with…

Category : Php   11-04-2013  

Learning Loops in Php: The while and do-while Loops

While loops are the simplest type of loop in PHP. They behave just like their C counterparts. The basic form of a while statement is:   while (expr) statement This is why a for loop is suitable when you have to carry out a finite number of actions. There may be times though when you need to carry out repetitive…

Category : Php   11-04-2013  



We use our own cookies and third-party cookies to improve our services, show products based on your preferences, analyse the browsing habits of our users, and enable interaction with social networks. Continuing to browse our sites implies full acceptance of their use. You can change your cookie setting or get more information here: Cookies policy .