PHP notes :)

Overview

php_notes

Echo [ echo ]

  • echo

Variables [ var ]

  • basic var
  • define
  • global

Arithmetic

  • Addition
  • Subtraction
  • Multiplication
  • Division
  • Modules -Data type
  • Boolean
  • x++ and x--

Comparison

CHEESE!

Logical Operators

  • and : true if x and y true
  • or : true if x or y true
  • xor : true if x or y true,but not both
  • ! : true if x is not true

Arrey

  • $name=array("a", "b","c")
  • $name[0] = "a"
  • $name[1] = "b"

Associative Arrays

  • $people = array("David"=>"27", "Amy"=>"21", "John"=>"42");
  • $people['Amy'] = "21";

Conditions [ifelse]

  • if (condition){---} else {---}
  • elif = elseif
  • elseif (conditions)

while loop [ while ]

  • The do...while loop will always execute the block of code once, check the condition, and repeat the loop as long as the specified condition is true
  • $i=0;do {echo "Hai";}while ($i <0);

Switch [ switch ]

Include

  • like python import
  • php include 'header.php';

forloop

  • for (--;--;--){-----}

function

  • When using default arguments, any defaults should be on the right side of any non-default arguments; otherwise, things will not work as expected
  • function num($a=10) :- if in num parameter not passed, it defaultly take $a=10

$_SERVER

  • $_SERVER is an array that includes information such as headers, paths, and script locations. The entries in this array are created by the web server. $_SERVER['SCRIPT_NAME'] returns the path of the current script:
  • eg: file name = index.php then,$_SERVER['SCRIPT_NAME'] == index.php
  • $_SERVER['HTTP_HOST'] returns the Host header from the current request. CHEESE!
You might also like...
Easy to use utility functions for everyday PHP projects. This is a port of the Lodash JS library to PHP

Lodash-PHP Lodash-PHP is a port of the Lodash JS library to PHP. It is a set of easy to use utility functions for everyday PHP projects. Lodash-PHP tr

A PHP 5.3+ and PHP 7.3 framework for OpenGraph Protocol

Opengraph Test with Atoum cd Opengraph/ curl -s https://getcomposer.org/installer | php php composer.phar install --dev ./vendor/atoum/atoum/bin/atoum

A status monitor for Elite Dangerous, written in PHP. Designed for 1080p screens in the four-panel-view in panel.php, and for 7 inch screens with a resolution of 1024x600 connected to a Raspberry Pi.

EDStatusPanel A status monitor for Elite Dangerous, written in PHP. Designed for 1080p screens in the four-panel-view in panel.php, and for 7 inch scr

🐘 A probe program for PHP environment (一款精美的 PHP 探針, 又名X探針、劉海探針)

Simplified Chinese | 简体中文 Traditional Chinese(Taiwan) | 正體中文(臺灣) Traditional Chinese(Hong Kong) | 正體中文(香港) Japanese | 日本語 😎 X Prober This is a probe

PHP Text Analysis is a library for performing Information Retrieval (IR) and Natural Language Processing (NLP) tasks using the PHP language

php-text-analysis PHP Text Analysis is a library for performing Information Retrieval (IR) and Natural Language Processing (NLP) tasks using the PHP l

PHP generics written in PHP

PHP generics written in PHP Require PHP = 7.4 Composer (PSR-4 Autoload) Table of contents How it works Quick start Example Features Tests How it work

PHP exercises from my course at ETEC and some of my own play-around with PHP

etec-php-exercises PHP exercises from my course at ETEC and some of my own play-around with PHP Translations: Português (BR) Projects Project Descript

GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and various tools.
GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and various tools.

GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and various tools.

php-echarts is a php library for the echarts 5.0.

php-echarts 一款支持Apache EChart5.0+图表的php开发库 优先ThinkPHP5/6的开发及测试。 Apache EChart5.0已经最新发布,在视觉效果、动画效果和大数据展示方面已经远超之前的版本; 故不考虑EChart5.0之前版本的兼容问题;建议直接尝试5.0+

Owner
Ag3ntQ
Ag3ntQ
This repository contains research materials and dev notes for the DSM research

DSM Research This repository contains a loosely-organized information regarding the processes of DSM loading. A lot of information present here was co

DSM 11 Jun 28, 2021
Preparation notes for Magento 2 Certified Professional Cloud Developer exam

Overview Magento 2 Certified Professional Cloud Developer 1. Topics 13% 1 - Commerce Cloud Fundamentals (8 questions) 9% 2 - Local Environment (6 ques

Magento Notes 78 Dec 26, 2022
Preparation notes for Magento 2 Certified Professional Developer exam

Overview Magento 2 Certified Professional Developer notes 1. Topics 18% 1 - Magento Architecture and Customization Techniques (11 questions) modules,

Magento Notes 669 Dec 19, 2022
WeExpire is an opensource tool for creating emergency notes that can be read by your trusted contacts only after your death or if you are seriously injured

WeExpire is an opensource tool for creating emergency notes that can be read by your trusted contacts only after your death or if you are

Francesco 36 Nov 24, 2022
DeNOTE: Encrypted, Private, and Secure Notes.

DeNOTE Welcome to DeNOTE, the private encrypted one-view note-taking platform. DeNOTE is still in beta, so our UI is not very good :(. WHAT IT DOES: D

mrfakename 1 Nov 7, 2022
The Current US Version of PHP-Nuke Evolution Xtreme v3.0.1b-beta often known as Nuke-Evolution Xtreme. This is a hardened version of PHP-Nuke and is secure and safe. We are currently porting Xtreme over to PHP 8.0.3

2021 Nightly Builds Repository PHP-Nuke Evolution Xtreme Developers TheGhost - Ernest Allen Buffington (Lead Developer) SeaBeast08 - Sebastian Scott B

Ernest Buffington 7 Aug 28, 2022
A sampling profiler for PHP written in PHP, which reads information about running PHP VM from outside of the process.

Reli Reli is a sampling profiler (or a VM state inspector) written in PHP. It can read information about running PHP script from outside of the proces

null 272 Dec 22, 2022
PHP Meminfo is a PHP extension that gives you insights on the PHP memory content

MEMINFO PHP Meminfo is a PHP extension that gives you insights on the PHP memory content. Its main goal is to help you understand memory leaks: by loo

Benoit Jacquemont 994 Dec 29, 2022
A sampling profiler for PHP written in PHP, which reads information about running PHP VM from outside of the process.

Reli Reli is a sampling profiler (or a VM state inspector) written in PHP. It can read information about running PHP script from outside of the proces

null 258 Sep 15, 2022
A multithreaded application server for PHP, written in PHP.

appserver.io, a PHP application server This is the main repository for the appserver.io project. What is appserver.io appserver.io is a multithreaded

appserver.io 951 Dec 25, 2022