background preloader

PHP

Facebook Twitter

Kom igång med objektorienterad PHP-programmering på 20 steg. MAMP & MAMP PRO: Using MySQL command line with MAMP. PMWD5E/vieworders.php at master · lauraxt/PMWD5E. Webbguider - Start. Need a web developer? Hire me! — Juan Treminio — Dallas based senior web developer. Need a web developer?

Need a web developer? Hire me! — Juan Treminio — Dallas based senior web developer

Hire me! I am a full-stack senior web developer with a strong focus on backend development. I can take your idea and build it from the ground up. This includes everything from server creation and management, PHP backend and API endpoints, HTML5/CSS/Javascript frontend, complete testing suite, build systems and deployment process. I am available for short-term and long-term contract projects, but perform my work after-hours. To quickly get in touch with me, email me at jtreminio@gmail.com. Launch the PHPStorm Remote Debugger from a PHPUnit Test – Stephen Rhoades.

I recently downloaded the trial version of PHPStorm 6 and was exploring how I could initiate the debugger while running a command-line unit test, having the capability of debugging code while unit testing is a necessity for me.

Launch the PHPStorm Remote Debugger from a PHPUnit Test – Stephen Rhoades

After a bit of investigation I stumbled upon a great article by Rafael Dohms discussing how to accomplish this with Netbeans. In this quick tutorial I’ll walk you through the steps for doing the same thing in PHPStorm 6. Artiklar - Introduktion till objektorienterad programmering. I denna artikeln får du lära dig vad objektorienterad programmering är och grunderna i det.

Artiklar - Introduktion till objektorienterad programmering

OOP är en förkortning för ObjektOrienterad Programmering, och det är inte ett eget språk, utan snarare ett sätt att tänka på när man strukturerar upp sin kod. Två andra sätt att tänka på är funktionell respektive imperativ programmering. Install Nginx, PHP and MySQL on OS X · frdmn's Notes. Recently I got a new MacBook Pro and decided to set it up from scratch, because I've used the same Time Machine backup to migrate from about four years over and over again.

Install Nginx, PHP and MySQL on OS X · frdmn's Notes

Perfect time to get rid of the LAMP (Linux Apache MySQL PHP) web server stack and replace it with Nginx and PHP-FPM. Below you can read a detailed guide how to setup Nginx, PHP-FPM, MySQL and phpMyAdmin on OS X 10.9 / Mavericks. Updated for Yosemite users: Updated the guide for OS X 10.10 since Yosemite is officially released. The steps are basically the same as for the Mavericks installation. First of all, get the latest Xcode version (6.1) via the Mac App Store: Mac App Store link As soon as the download is finished, open Xcode.app in your /Applications folder and agree to the licence. Open a new Terminal.app window and install the Xcode command line tools: xcode-select --install Confirm the installation dialog with Install. Make sure you have at least Xcode 6.1! (Re)installing PHP on Mac OS X — justin hileman dot info. GitHub - Homebrew/homebrew-php: PHP macOS formulae for the Homebrew package manager.

Install and run PEAR on OSX 10.11 El Capitan. PEAR is a popular PHP package manager, it doesn’t come by default on OSX, here is a tutorial how to install PEAR on OSX 10.11 El Capitan and earlier versions of OSX including Yosemite and Mavericks.

Install and run PEAR on OSX 10.11 El Capitan

These commands need to be entered via the command line so crank open your Terminal application. First up. How to setup a local server (in a virtual machine) with Vagrant in PHPStorm - Dev Metal. The Joy of Regular Expressions [1] Was asked recently if I knew of any good regular expressions tutorials (preferably in PHP).

The Joy of Regular Expressions [1]

The question came from someone certainly smart enough to “get” regular expressions but they’d been unable to find accessible help. Most regular expression tutorials I’ve seen are organised around teaching the syntax incrementally, which can quickly lead to mental overload. Examples commonly revolve around strings like ‘aaabbababa’…” – great if you’re writing a web crawler for Swedish pop, but confusing for anyone else. And while there are copy and paste regular expressions on-line, if you don’t know what you’re doing, using them can be worse than not at all. Do they meet your needs? Presentations on PHPUnit – The PHP Testing Framework. Install PHP7.1 on OSX with homebrew — Jack Skinner — Ramblings of a programmer.

Install PHP7 on OSX with homebrew — Jack Skinner — Ramblings of a programmer. There's rarely a quiet night in with me, tonight I upgraded my local box to PHP7 (so I don't need to use VM's or docker containers).

Install PHP7 on OSX with homebrew — Jack Skinner — Ramblings of a programmer

Took about 10 minutes on my internet connection so there's time to grab a coffee while it downloads! I used these homebrew instructions from Justin Hileman as the basis for the guide. If you haven't already, you'll need to have accepted Xcode's license agreement; a simple sudo xcodebuild -license should suffice. Steps to upgrade. Using spl_autoload_register to Load All Classes in a PHP Project - Web Tips. Home / PHP / Using spl_autoload_register to Load All Classes in a PHP Project If you have a several classes in your PHP project then you already know how annoying it can be to constantly include the class files before instantiating your class.

Using spl_autoload_register to Load All Classes in a PHP Project - Web Tips

You may already know about spl_autoload and related functions, but it can still be a pain creating a function for each directory and registering each file within. An easier way to go about this is to recursively register every file in your root directory regardless of how deep your directory structure is. The easy re-usable solution is to create a function that will loop through all of your directories and include the file that matches the class. Now you won’t need to include any class files to your project.

Webbprogrammering och Databaser. Kom igång med SQLite och PHP PDO. Why you Should be using PHP's PDO for Database Access - Tuts+ Code Tutorial. Many PHP programmers learned how to access databases by using either the MySQL or MySQLi extensions.

Why you Should be using PHP's PDO for Database Access - Tuts+ Code Tutorial

As of PHP 5.1, there's a better way. GitHub - Kroc/PHPtitleCase: An improved Title Case Function for PHP based on John Gruber and David Gouch’s work. Improved Title Case Function for PHP. John Gruber originally made available his script to Title Case text, working around the fringe-cases.

Improved Title Case Function for PHP

From this, a number of ports were made of the script of which particularly noteworthy David Gouch’s Javascript port that was smaller, simpler and handled more fringe cases. I’ve ported this to PHP and put it to use on this site. My version is based on David Gouch’s Javascript port, unlike the WordPress port which is, frankly, crap. Ironically, now there’s a WordPress port that uses my port.

The circle is complete! Code below. Anything broken, please let me know. How to Use PHP Namespaces, Part 1: The Basics. Namespaces are one of the most significant changes in PHP 5.3. They will be familiar to C# and Java developers, and they are likely to change the structure of PHP applications for the better. The Definitive Guide To PHP's isset And empty.

PHP has two very similar functions that are essential to writing good PHP applications, but whose purpose and exact function is rarely well explained: isset and empty. The PHP manual itself doesn't have a simple explanation that actually captures their essence and most posts written around the web seem to be missing some detail or other as well. This article attempts to fill that gap; and takes a broad sweep of related topics to do so. » PHP Constructor Best Practices And The Prototype Pattern Ralph Schindler. If your knowledge of constructors ends with “the place where I put my object initialization code,” read on. While this is mostly what a constructor is, the way a developer crafts their class constructor greatly impacts the initial API of a particular class/object; which ultimately affects usability and extensibility. After all, the constructor is the first impression a particular class can make.

Constructors, in their current form, have been in PHP since 5.0.0. Previous to 5.0, PHP loosely followed the style similar to that of C++ where the name of the method matching the name of the class would act as the class constructor. PHP 5 brought us the __construct() “magic method” which greatly formalized the new object initialization routine.

The Constructor Signature class Foo { public function __construct() { } } $object = new Foo(); This means that all of the following are legal: The above, with E_STRICT enabled, will not produce a warning. Object Oriented PHP for Beginners: Page 1 – KillerPHP.com. Object Oriented PHP for Beginners: Steps 1 – 5 For this tutorial, you should understand a few PHP basics: functions, variables, conditionals and loops. To make things easy, the tutorial is divided into 22 steps. Table of Contents – Hacking with PHP - Practical PHP. Magic Methods or Functions in PHP - PHP OOP Tutorial. Magic methods in php are some predefined function by php compiler which executes on some event. Magic methods starts with prefix __, for example __call, __get, __set.

I am including magic methods topic in my oop tutorial here because these method mostly applied in classes of PHP. If you have gone through my previous chapter then you have seen __construct function. __construct is a magic method which automatically call on creating object of the classes. Object-Oriented PHP for Beginners. Operators - Reference - What does this symbol mean in PHP? SPL. PHP Syntax Overview.