Answer the question
In order to leave comments, you need to log in
How to pass parameters to php array?
How to pass parameters from $a, $b, $c to $array? The sequence of variables is
<?php
$array = array(
1 => $a,
2 => $b,
3 => $c,
);
$result = $array[2]; //дальше мне надо будет работать с этими данными
//Ниже передаем параметры
$a = 20;
$b = 30;
$c = 40;
Answer the question
In order to leave comments, you need to log in
$array = array(
1 =>0,
2 =>0,
3 =>0,
);
$array[1]= &$a;
$array[2]= &$b;
$array[3]= &$c;
$a = 20;
$b = 30;
$c = 40;
$array = array(
1 => &$a,
2 => &$b,
3 => &$c,
);
$a = 20;
$b = 30;
$c = 40;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question