PHP- Function arguments

codedixa php

PHP- Function arguments Information may be passed to functions via the argument list, which is a comma-delimited list of expressions. The arguments are evaluated from left to right. PHP supports passing arguments by value (the default), passing by reference, and default argument values. Variable-length argument lists and Named Arguments are also supported. Example #1 Function with one argument Example #2 Function … Read more

PHP Functions

PHP Functions PHP function is a piece of code that can be reused many times. It can take input as argument list and return value. There are thousands of built-in functions in PHP. The real power of PHP comes from its functions. Advantage of PHP Functions Code Reusability: PHP functions are defined only once and … Read more

PHP Multidimensional Arrays

CodeDixa PHP

PHP Multidimensional Arrays In the previous article, we have described arrays that are a single list of key/value pairs.However, sometimes you want to store values with more than one key. For this, we have multidimensional arrays. A multidimensional array is an array containing one or more arrays. PHP supports multidimensional arrays that are two, three, … Read more

PHP Associative Arrays

PHP Associative Arrays Syntax: Syntax for associative arrays: Associative arrays are arrays that use named keys that you assign to them. There are two ways to create an associative array: or the key and value can be assigned manually: The named keys can then be used in a script: Loop Through an Associative Array: To … Read more

PHP Indexed Arrays

PHP Indexed Arrays Syntax: Syntax for indexed arrays: There are two ways to create indexed arrays: The index can be assigned automatically (index always starts at 0), like this: or the index can be assigned manually: The following example creates an indexed array named $names, assigns three elements to it, and then prints a text … Read more