Search
 
SCRIPT & CODE EXAMPLE
 

PHP

list() php

$info = array('Doina', 'brown', 'long');

// Listing all the variables
list($she, $color, $hear) = $info;
echo "$she has $color eyes color and $hear black hair.
";
Comment

list function PHP


<?php

$info = array('coffee', 'brown', 'caffeine');

// Listing all the variables
list($drink, $color, $power) = $info;
echo "$drink is $color and $power makes it special.
";

// Listing some of them
list($drink, , $power) = $info;
echo "$drink has $power.
";

// Or let's skip to only the third one
list( , , $power) = $info;
echo "I need $power!
";

// list() doesn't work with strings
list($bar) = "abcde";
var_dump($bar); // NULL
?>

Comment

PREVIOUS NEXT
Code Example
Php :: substr_count excact match php 
Php :: what is php 
Php :: socket io laravel 
Php :: model not found laravel 
Php :: php functions 
Php :: scss laravel 
Php :: php return multiple variables from function 
Php :: id type laravel 
Php :: Generate Laravel Migrations from an existing database 
Php :: laravel run command 
Php :: sass for php 
Php :: laravel routing 
Php :: create an email addresses php 
Php :: whats the difference between using date function and DATETime in php 
Php :: php string concatenation 
Php :: php array_map 
Php :: check box with value in php 
Php :: phpadmin 
Php :: Get the Last Character of a String in PHP 
Php :: how to pass write post method in lumen 
Php :: laravel htaccess to remove public from url 
Php :: redirecionar tienda agregar carrito woocommerce 
Php :: facetwp listing template archive 
Php :: Wampserver does not use, modify or require the PATH environment variable. 
Php :: laravel collection tap 
Php :: Limit number of words to be displayed on blog post excerpt with Laravel 
Php :: get git branch with php 
Php :: wordpress add_action echo on edit page 
Php :: .htaccess Preventing access to your PHP includes files 
Php :: wc php coupon applied message still after coupon delete 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =