Infinite Education
Play & Learn
Prices
Upgrade
Login
Knowledge
I know it!
Select
Subject:
...
/
skillest php
Skillsets
skillest php
by hussam aldaj
2 users
Materials
If you know useful resource, that helps to get this skill, please, spare a minute and add the link
Add Materials
Do you know that ...?
Any useful or interesting facts about the skill. Any peace of information would be useful
Add Statement
skillest php
basic Structures PHP
Printing
print_r($arr);
echo($var);
variable checking
var_dump(isset($fruits[2]));
is_double(3.45);
is_numeric("3.45");
is_integer(3.4);
is_int(3.4);
is_float(1.25);
Control Structures PHP
selection structure if else
Nested ternary
$age < 22 ? ($age < 16 ? 'Too young' : 'Young') : 'Old';
Ternary if
$age < 22 ? 'Young' : 'Old';
iterative structures foreach
continue
selection structure switch
break
iterative structures while
iterative structures for
selection structure if
iterative structures do while
Operators PHP
Declaring numbers
Arithmetic operations
comparison operators
== , === , <> , >= , <= , > , < , ?
Decrement operator
--$n2;
$n2--;
Increment operator
$n1++;
++$n1;
Assignment with math operators
$n2 = $n2 * 3;
$n1 *= 3;
logical operators
&& , | |, !
basic for coding
Setup Mac Environment
Setup Windows Environment
Comment
/* Multiline comment with some long text */
# Another single line comment
// Single line comment
Arithmetic conversions
$strNumber = '12.34';
$number = intval($strNumber);
$number = floatval($strNumber);
$number = (float)$strNumber;
$number = (int)$strNumber;
PHP Variables
Float
$height = 1.85;
Integer
$age = 28;
Null
$salary = null;
Boolean (bool)
$isMale = true;
String (string)
Declaring string
$name = "Zura";
String functions
strlen(string $string)
explode(string $separator, string $string, int $limit = PHP_INT_MAX)
implode(string $separator, array $array)
md5(string $string, bool $binary = false)
md5_file(string $filename, bool $binary = false)
str_split(string $string, int $length = 1)
trim(string $string, string $characters = " \n\r\t\v\x00")
str_word_count(string $string, int $format = 0, ?string $characters = null)
Array
Declaring array
$arr=array("var1","var2","var3",...)
associative array
$person = [ 'name' => 'Brad', 'surname' => 'Traversy', 'age' => 30, 'hobbies' => ['Tennis', 'Video Games'], ];
$arr=[var1,var2,var3,...]
operator array
Get element by index
$person['name']
Add element at the beginning of the array
array_unshift($fruits, 'Apple');
Remove element from the beginning of the array
array_shift($fruits);
Search element index in the array
array_search("Peach", $fruits,true)
Remove element
array_pop($fruits);
Print the length
count($arr)
Sorting associative arrays by values, by keys
ksort, krsort, asort, arsort
ksort($person);
Print the values of the array
array_values($person)
Merge two arrays
array_merge($fruits, $vegetables)
Print the keys of the array
array_keys($person)
Sorting of array
sort($fruits);
Add element
array_push($fruits, 'Foo');
Set element by index
$person['channel'] = 'TraversyMedia';
function php
User-defined functions
Function arguments
Returning values
Anonymous functions
Arrow Functions
Constants
define
const
PHP: OOP basics
Classes variables
const
public
private
protected
Constructor
__construct($variable)
Inheritance
extends
Magic Methods
__namemethods
Interface
Access statically
PHP: Anonymous classes
Keyword
Final
$this
getter && setter
Scope Resolution Operator (::)
Magic constants
__FILE__
__DIR__
__line__
Read files and folders inside directory
Exception in PHP 8.0
Basic error handling
Namespaces
Predefined Variables
$GLOBALS
$_SERVER
$_GET
$_POST
$_FILES
$_REQUEST
$_SESSION
$_ENV
$_COOKIE
$php_errormsg
$http_response_header
$argc
$argv
HTML && CSS
HTML
CSS
javascript
HTTP
HTTP body
HTTP header
Nginx
Client Server Architecture
REST
Web Session
Cookie Based
Relational Databases
other problem
for arabic language
mysqli_set_charset($conn, 'utf8');
UPDATE
Select
SQL Connection
PDO
mysqli_connect
DELETE
insert
ERROR Handling
SQL Syntax
Add statement
×
Briefly
Text
You could leave this field empty
Add question
×
Question
×
Correct answer
+
correct answer
+
incorrect answer
Load image
Explanation
All correct answers are required (multi-choice)
Allow custom answer
Allow file answer
Add material
×
Url
Inaccessible URL
Author
Language
العربية
Asturianu
Azərbaycanca
Български
Bân-lâm-gú / Hō-ló-oē
Беларуская
Català
Čeština
Cymraeg
Dansk
Deutsch
Eesti
Ελληνικά
English
Español
Esperanto
Euskara
فارسی
Français
Galego
Հայերեն
हिन्दी
Hrvatski
Bahasa Indonesia
Italiano
עברית
ქართული
Latina
Latviešu
Lietuvių
Magyar
Македонски
مصرى
Bahasa Melayu
Bahaso Minangkabau
Nederlands
日本語
Norsk (bokmål)
Norsk (nynorsk)
Нохчийн
Oʻzbekcha / Ўзбекча
Polski
Português
Қазақша / Qazaqşa / قازاقشا
Română
Русский
Sinugboanong Binisaya
Slovenčina
Slovenščina
Српски / Srpski
Srpskohrvatski / Српскохрватски
Suomi
Svenska
தமிழ்
Татарча / Tatarça
ภาษาไทย
Тоҷикӣ
تۆرکجه
Türkçe
Українська
اردو
Tiếng Việt
Volapük
Winaray
中文
한국어
Type
Article
Tutorial
Course
Video
Book
Documentation
Forum
Post
Other
Level of Material
None
🍸 Introduction
📚 Basic
🎓 Advanced
🏆 Professional
💎 Expert
🚀 Cutting Edge
Title
Description
Short description how this links relates to the skill.