Associative Arrays

Are more intuitive than index arrays. Similar to classes. In place of keys you can use names instead of numbers. How to create On one line: $pop= array("brazil"=>"110", "portugal"=>"10"); One by one: $pop['brazil']...

Verb être (to be) – irregular

Conjugated forms Expressions with être être à l’heure/en retard/en avance (to be on time/late/early) être d’accord (avec) (to agree [with]) être de retour (to be back [from a trip or outing]) être en coton/en cuir/en briques… (to be made of cotton/leather/brick...

PHP Arrays Intro

Motivation Used to store several values in one variable. Say you need to store your contacts. contacts = array (‘paula’,’maria’, ‘bob’ ); Adding elements to existing array $carribean = array("RD", "Jamaica", "Colombia"); $carribean[] =...

Two ways to iterate over php indexed array

$cars = array("a", "b", "c"); $arrlength = count($cars); for($x = 0; $x < $arrlength; $x++) { echo $cars[$x]; echo "<br>"; } echo "<hr>"; foreach($cars as $x) { echo $x; echo "<br>";...

How to Remove HTML tags and all special characters

<?php // $str = "<h1>Africa ≠ America ÆØÅ! &+ </h1>"; // Remove HTML tags and all characters with ASCII value > 127 $str2 = filter_var($str, FILTER_SANITIZE_STRING,FILTER_FLAG_STRIP_HIGH); echo $str2; // result: Africa America !...