[ create a new paste ] login | about

Link: http://codepad.org/hQe56tEU    [ raw code | output | fork ]

PHP, pasted on Jun 15:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
$standard_image_2 = 'This is the variable variable 2';
$standard_image_4 = 'This is the variable variable 4';

$steps = array(
 0=>array(
  'number'=>2
 ),
 1=>array(
  'number'=>4
 )
);

foreach ($steps as $step) {
  echo ${'standard_image_'.$step['number']}; 
}

?>


Output:
1
This is the variable variable 2This is the variable variable 4


Create a new paste based on this one


Comments: