PHP Array Bayu Priyambadha, S.Kom. Array Array is collection of data that is saved in some place together and it is can accessed using index key 2 Kinds.

Slides:



Advertisements
Similar presentations
» PHP arrays are lists of values stored in key-value pairs. » Uses of arrays: Many built-in PHP environment variables. Database functions use arrays.
Advertisements

Arrays Strings and regular expressions Basic PHP Syntax CS380 1.
Model View Controller Bayu Priyambadha, S.Kom. PHP & MVC  The model view controller patternis the most used pattern fortoday’s world web applications.
PHP Using Arrays.
Merge and Count Merge and count step. n Given two sorted halves, count number of inversions where a i and a j are in different.
Data Structures & Algorithms
PHP Functions Composite Types. Functions  Declaration  function functionName(paramList) {  /* code goes here */ }  paramList is comma-separated list.
Places To Put Things Exploring Perl's Built-In Variable Containers: Arrays and Hashes.
Summary of lectures (1 to 11)
Презентація за розділом “Гумористичні твори”
Центр атестації педагогічних працівників 2014
Галактики і квазари.
Характеристика ІНДІЇ.
Процюк Н.В. вчитель початкових класів Боярської ЗОШ І – ІІІ ст №4
Selection Sort
REMEMBER: A number can be negative or positive as shown in the number line below: Negative Numbers (-) Positive Numbers (+)
Counting Inversions Merge and count step. n Given two sorted halves, count number of inversions where a i and a j are in different.
Class 3Intro to Databases Arrays Sending Values to a Script Manually For and While Loops.
NUMERIC ARRAYS IN PHP BY SKYLAR NEILSON. WHAT ARE NUMERIC ARRAYS? They are arrays with a numeric index and the values are stored and accessed in linear.
Arrays By Shyam Gurram. What is an Array? An array can store one or more values in a single variable name. Each element in the array is assigned its own.
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
Introduction to PHP – Part 2 Sudeshna Dey. Arrays A series of homogeneous elements Elements have values in form of stored data Has a key associated with.
1 PHP Intro PHP Arrays After this lecture, you should be able to: Create and manipulate PHP Arrays: Create and manipulate PHP Arrays: Indexed Arrays Indexed.
Slide 1 PHP Arrays and User Defined Functions ITWA133.
Priority Queue. Priority Queues Queue (FIFO). Priority queue. Deletion from a priority queue is determined by the element priority. Two kinds of priority.
Python Arrays. An array is a variable that stores a collection of things, like a list. For example a list of peoples names. We can access the different.
Духовні символи Голосіївського району
Selection Sort
Data Structures for Midterm 2. C++ Data Structure Runtimes.
CHAPTER 7 Introduction to PHP5 Part II อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
ITM ITM 352 Array Processing. ITM Simple Array Processing  Arrays can be processed using iteration. Standard array-processing loop:  What.
Review Array – int[] diameters = new int[10]; – diameters[0], diameters[2], diameters[9] – diameters.length Indexing starts at 0 A way to have a collection.
Max(), with an array argument, returns the largest value in the array  With several numerical arguments, it returns the largest argument E.g., $arr =
Class02 More Arrays MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 1/14/2016.
ARRAYS IN C/C++ (1-Dimensional & 2-Dimensional) Introduction 1-D 2-D Applications Operations Limitations Conclusion Bibliography.
JavaScript and Ajax (JavaScript Arrays) Week 5 Web site:
Creating PHP Pages Chapter 10 PHP Arrays. Arrays An array can store one or more values in a single variable name. An element of an associative accessed.
11 – Introduction to PHP(1) Informatics Department Parahyangan Catholic University.
Chapter 16: Searching, Sorting, and the vector Type.
1 PHP Array PHP Arrays An indexed array is similar to one provided by a conventional programming language. An indexed array is similar to one provided.
Lesson 3 Functions. Lesson 3 Functions are declared with function. For example, to calculate the cube of a number function function name (parameters)
Standard 14 Solve by completing the square. Example One. Instructions: Factor Perfect Square.
Arrays in PHP are quite versatile
Chapter 5: Lists and Dictionaries
Connecting Number Words, Numerals and Models
Проф. д-р Васил Цанов, Институт за икономически изследвания при БАН
ЗУТ ПРОЕКТ на Закон за изменение и допълнение на ЗУТ
О Б Щ И Н А С И Л И С Т Р А П р о е к т Б ю д ж е т г.
Електронни услуги на НАП
Боряна Георгиева – директор на
РАЙОНЕН СЪД - БУРГАС РАБОТНА СРЕЩА СЪС СЪДЕБНИТЕ ЗАСЕДАТЕЛИ ПРИ РАЙОНЕН СЪД – БУРГАС 21 ОКТОМВРИ 2016 г.
Сътрудничество между полицията и другите специалисти в България
Съобщение Ръководството на НУ “Христо Ботев“ – гр. Елин Пелин
НАЦИОНАЛНА АГЕНЦИЯ ЗА ПРИХОДИТЕ
ДОБРОВОЛЕН РЕЗЕРВ НА ВЪОРЪЖЕНИТЕ СИЛИ НА РЕПУБЛИКА БЪЛГАРИЯ
Съвременни софтуерни решения
ПО ПЧЕЛАРСТВО ЗА ТРИГОДИШНИЯ
от проучване на общественото мнение,
Васил Големански Ноември, 2006
Програма за развитие на селските райони
ОПЕРАТИВНА ПРОГРАМА “АДМИНИСТРАТИВЕН КАПАЦИТЕТ”
БАЛИСТИКА НА ТЯЛО ПРИ СВОБОДНО ПАДАНЕ В ЗЕМНАТА АТМОСФЕРА
МЕДИЦИНСКИ УНИВЕРСИТЕТ – ПЛЕВЕН
Стратегия за развитие на клъстера 2015
Моето наследствено призвание
Правна кантора “Джингов, Гугински, Кючуков & Величков”
Безопасност на движението
PHP an introduction.
Jeopardy.
+/- Numbers Year 3-4 – Addition and subtraction of hundreds within
Presentation transcript:

PHP Array Bayu Priyambadha, S.Kom

Array Array is collection of data that is saved in some place together and it is can accessed using index key 2 Kinds of Array : ◦ Array with numeric index ◦ Associative Array

Array With Numeric Index Array with numeric index Example : $suku = array(”Jawa”,”Sunda”,”Batak”,”Minang”); Or $suku[0] = ”Jawa”; $suku[1] = ”Sunda”; $suku[2] = ”Batak”; $suku[3] = ”Minang”; ABCDEFGH

Associative Array Array with index based on current name Example : $suku = array(“satu” => “Jawa”, “dua” => “Sunda”, “tiga” => “Batak”, “emapat” => “Minang”); SatuDuaTigaEmpatLimaEnamTujuhDelapan ABCDEFGH

Array Manipulation Adding Array (Push) Merge Array Deletion Array Sorting Array

Adding Array (Push) Used to adding array data to existing array PHP function : array_push() Example : $suku = array(”Jawa”,”Sunda”); array_push($suku, ”Batak”, ”Minang”);

Merge Array Used to merge two array PHP function : array_merge(); Example : $satu = array(”Jawa”, ”Sunda”); $dua = array(”Batak”, ”Minang”); $gabung = array_merge($satu, $dua);

Deletion Array (1) Used to delete data in array PHP function : array_shift(); array_pop(); Example : $suku = array(”Jawa”, “Sunda”, “Batak”); $suku_baru = array_shift($suku); $suku = array(”Jawa”, “Sunda”, “Batak”); $suku_baru = array_pop($suku);

Deletion Array (2) How to delete the middle data? PHP function : array_ splice(); Example : $arr = array("zero","one", "two", "three", "four", "five", "six"); array_splice($arr,3,2);

Sorting Array (1) Used to sort array data PHP function : sort(); Example : $nama = array(”abi”,”bobo”,”cica”,”ani”); sort($nama);

Sorting Array (2) asort() ksort() rsort() arsort() krsort()