Back to Browse

Learn PHP Tutorial in Hindi 19 explode function and compact function

1.0K views
Oct 9, 2015
5:15

This video is made for learning about explode function and compact function in PHP in Hindi. compact — Create array containing variables and their values Description ¶ array compact ( mixed $varname1 [, mixed $... ] ) Creates an array containing variables and their values. For each of these, compact() looks for a variable with that name in the current symbol table and adds it to the output array such that the variable name becomes the key and the contents of the variable become the value for that key. In short, it does the opposite of extract(). Any strings that are not set will simply be skipped. Parameters ¶ varname1 compact() takes a variable number of parameters. Each parameter can be either a string containing the name of the variable, or an array of variable names. The array can contain other arrays of variable names inside it; compact() handles it recursively. explode — Split a string by string Description ¶ array explode ( string $delimiter , string $string [, int $limit ] ) Returns an array of strings, each of which is a substring of string formed by splitting it on boundaries formed by the string delimiter. Parameters ¶ delimiter The boundary string. string The input string. limit If limit is set and positive, the returned array will contain a maximum of limit elements with the last element containing the rest of string. If the limit parameter is negative, all components except the last -limit are returned. If the limit parameter is zero, then this is treated as 1.

Download

0 formats

No download links available.

Learn PHP Tutorial in Hindi 19 explode function and compact function | NatokHD