Answers for "php array list"

PHP
5

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.n";
Posted by: Guest on August-05-2020
0

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.n";

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

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

// list() doesn't work with strings
list($bar) = "abcde";
var_dump($bar); // NULL
?>
Posted by: Guest on June-21-2021
0

php array

array (
  'total_value_of_building' => 'a+(b-c*2)*2+101',
  'annual_payment' => 'a+b-c',
  'monthly_payment' => 'a+b-c*d',
)
Posted by: Guest on July-23-2021
0

php array

array (
  0 => '1',
  1 => '2',
  2 => '3',
  3 => '4',
)
Posted by: Guest on July-23-2021

Browse Popular Code Answers by Language