PHP: The Right Way
johnpapa/angular-styleguide
PHP MySql -Les boucles PHP
Nous aurons souvent besoin d'éxécuter des instructions plusieurs fois. Dans ce cas nous utiliserons des structures de boucle dont les principales sont : la boucle while (tant que)la boucle for (pour) La boucle While Exemple : «while» signifie «tant que». Un exemple concret : L'expression ci-dessus pourrait être traduite ainsi : «Tant que ma variable $count est inférieure ou égale à 10, alors écrire $count suivi d'un espace.» L'instruction $count = $count + 1; permet d'ajouter 1 à $count à chaque passage dans la boucle. Ce qui donne dans le navigateur : La boucle For Regardons à nouveau l'exemple précédent : On aura très souvent besoin avec la boucle «while» de 3 types d'instructions : l'initialisation, la condition et l'incrementation. «for» signifie «pour». Exemple L'expression ci-dessus pourrait être traduite ainsi : «Pour $i égale à 0, tant que $i est inférieure ou égale à 10, et en ajoutant 1 à $i à chaque tour, écrire $i suivi d'un espace.» <?
PHP 5 Tutorial
polarmobile/coffeescript-style-guide
PHP Master | Parsing XML With SimpleXML
Parsing XML essentially means navigating through an XML document and returning the relevant data. An increasing number of web services return data in JSON format, but a large number still return XML, so you need to master parsing XML if you really want to consume the full breadth of APIs available. Using PHP’s SimpleXML extension that was introduced back in PHP 5.0, working with XML is very easy to do. In this article I’ll show you how. Basic Usage Let’s start with the following sample as languages.xml: The above XML document encodes a list of programming languages, giving two details about each language: its year of implementation and the name of its creator. The first step is to loading the XML using either simplexml_load_file() or simplexml_load_string(). Both functions read the entire DOM tree into memory and returns a SimpleXMLElement object representation of it. You can access the properties of the object in the usual way with the -> operator. Dealing With Namespaces Conclusion
Table of Contents – Hacking with PHP - Practical PHP
AngularJS CoffeeScript Style Guide · Plateful/plateful-mobile Wiki
AngularJS Style Guide Opinionated AngularJS Coffeescript style guide for teams by @JoelCox Original Javascript style guide by @john_papa If you are looking for an opinionated style guide for syntax, conventions, and structuring AngularJS applications, then step right in. The styles contained here are based on on my experience with AngularJS, presentations, Pluralsight training courses and working in teams. The purpose of this style guide is to provide guidance on building AngularJS applications by showing the conventions I use and, more importantly, why I choose them. Community Awesomeness and Credit Never work in a vacuum. Many of my styles have been from the many pair programming sessions Ward Bell and I have had. Table of Contents Single Responsibility Rule of 1: Define 1 component per file. Back to top Modules Definitions (aka Setters): Declare modules without a variable using the setter syntax. Controllers Services Factories Directives Limit 1 Per File: Create one directive per file. Naming
$_GET
This Function will help you to manage your GET parameters to facilitate coding and prevent duplication. This is a basic version but it can be easily extended. <?php$cases = array ( 0 => array("s" => 1, "fi" => 2, "m" => 4, "p" => 3), 1 => array("s" => "", "fi" => "", "m" => 4, "p" => 3), ); $test[0] = array( "s" => "fi=2&m=4&p=3", "s&m" => "fi=2&p=3", "s=4" => "s=4&fi=2&m=4&p=3", "s=2&m" => "s=2&fi=2&p=3", "s=&m=3" => "s=&fi=2&m=3&p=3", "s=2&m=" => "s=2&fi=2&m=&p=3", "s=2&m:=" => "s=2&fi=2&p=3&m=", "z=9" => "s=1&fi=2&m=4&p=3&z=9", "z:" => "s=1&fi=2&m=4&p=3&z", "s:&m=3" => "fi=2&m=3&p=3&s", "s&m=3" => "fi=2&m=3&p=3", );$test[1] = array( "s" => "fi=&m=4&p=3", "s&m" => "fi=&p=3", "s=4" => "s=4&fi=&m=4&p=3", "s=2&m" => "s=2&fi=&p=3", "s=&m=3" => "s=&fi=&m=3&p=3", "s=2&m=" => "s=2&fi=&m=&p=3", "s=2&m:=" => "s=2&fi=&p=3&m=", "z=9" => "s=&fi=&m=4&p=3&z=9", "z:" => "s=&fi=&m=4&p=3&z", );
Comment tester son code PHP en ligne
S’il vous ait déjà arrivé d’avoir à tester une ou quelques lignes de code en PHP, cela devient vitre contraignant de démarrer wamp ou mamp, l’éditeur (notepad++, dreamweaver …), de les écrire et de les tester. Voici une solution très pratique pour tester son code PHP en ligne : writecodeonline. Avec writecodeonline, vous allez pouvoir tester votre code en ligne ! Donc très rapidement et sans à ouvrir plusieurs logiciel. URL-Encoder vous permet d’obtenir un lien ‘propre’.
Mini Convention CSS
Originellement conçu pour des web designers, CSS se veut être un langage de description et non de programmation. Mais ça c'était avant. Le Web a évolué, nos usages et consommations également. CSS s'adapte petit à petit au contexte actuel et se complexifie pour devenir "un vrai langage" (avec variables, calculs et fonctions, notamment). En attendant une hypothétique stabilisation du langage, nous en sommes aujourd'hui à déplorer des feuilles CSS de taille astronomique et de moins en moins maintenables en production. Par exemple, sur le site alsacreations.com (hors forum), sur un fichier CSS de 32ko, l'outil StyleStats ne dénombre pas moins de : 46 occurences de ! Une convention pour éviter la bidouille Pour améliorer notre quotidien d'intégrateur, l'agence Alsacréations s'est constitué une mini Convention CSS contenant toutes les bonnes pratiques qui nous paraissent essentielles à ce beau langage qu'est CSS. Lien vers la présentation :