PHP concatenate variable
Posted
by Jerry
on Stack Overflow
See other posts from Stack Overflow
or by Jerry
Published on 2010-05-20T18:55:27Z
Indexed on
2010/05/20
19:00 UTC
Read the original article
Hit count: 190
Hi guys. Might be an easy question for you guys. can't find it on google.
I am trying to concatenate two variables name;
$i=0;
for ($i=0;$i<5;$i++){
if($array[$i]>0){
$test.$i=//do something
}else{
$test.$i=//do something
}
}
//echo $test0 gives me nothing.
//echo $test1 gives me nothing.
I know I can't use $test.$i but don't know how to do this.Any helps? Thanks!
© Stack Overflow or respective owner