Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to store array in variable php

$something = array(
    'http://www.marleenvanlook.be/admin.php',
    'http://www.marleenvanlook.be/checklogin.php',
    'http://www.marleenvanlook.be/checkupload.php',
    'http://www.marleenvanlook.be/contact.php',
);

foreach($something as $key => $value) {
    $key = 'something' . $key;
    $$key = $value;

    // OR (condensed version)
    // ${"something{$key}"} = $value;
}

echo $something2;
// http://www.marleenvanlook.be/checkupload.php
Comment

how to store array in variable php

$myArray = array("http://www.marleenvanlook.be/admin.php","http://www.marleenvanlook.be/checklogin.php","etc");

$i = 0;
foreach($myArray as $value){
    ${'something'.$i} = $value;
    $i++;
    }

echo $something0; //http://www.marleenvanlook.be/admin.php
Comment

how to store array in variable php

$data = array(
    'something1',
    'something2',
    'something3',
);
extract($data, EXTR_PREFIX_ALL, 'var');
echo $var0; //Output something1
Comment

PREVIOUS NEXT
Code Example
Php :: php event listener 
Php :: laravel authentication tutorial 8 
Php :: artisan command to add resources to controller 
Php :: laravel seeder multiple column 
Php :: http_build_query 
Php :: Laravel9 Failed to listen on 127.0.0.1:8000 (reason: ?) 
Php :: image::make en php 
Php :: add taxonomy to custom post type 
Php :: logout php code 
Php :: laravel remove index.php from url 
Php :: php time passed since date 
Php :: views_pre_view 
Java :: how to make phone vibrate android studio 
Java :: how to print hello world in java 
Java :: spigot get player from uuid 
Java :: lombok maven dependency 
Java :: javafx get screen size 
Java :: java get mouse position on screen 
Java :: Java how to copy file 
Java :: java byte array to string 
Java :: filll 2d array in java 
Java :: random.choice in java 
Java :: array to map javax 
Java :: how to force garbage collection in java 
Java :: add label gui jframe java 
Java :: how to set event priority in spigot 
Java :: arraylist with values java 
Java :: internet permission android 
Java :: from string to double andoird studio 
Java :: feignException byteBuffer to string 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =