[英]Print Array Elements on one line
I'm populating an array variable $array
at some point in my code, for example like below我在代码中的某个位置填充了一个数组变量
$array
,例如如下所示
this
is
an
array
varaible
What if, I wanted to print out the array variable like thisisanarrayvariable
as one liner如果,我想打印出像
thisisanarrayvariable
这样的数组变量作为一个衬里
i took the below approach, but i'am not getting any out while the program is hanging我采用了以下方法,但是在程序挂起时我没有得到任何结果
for ($i=0;$i -le $array.length; $i++)
{ $array[$i] }
for ($i=0;$i -le $array.length; $i++)
{ $array[$i] }
obviuosly, i dont want to glue them together like $array[0]+$array[1]+$array[2]..
显然,我不想像
$array[0]+$array[1]+$array[2]..
Hope i can get a better answer.希望我能得到更好的答案。
I'm populating an array variable $array
at some point in my code, for example like below我在代码中的某个时候填充了数组变量
$array
,例如下面的例子
this
is
an
array
varaible
What if, I wanted to print out the array variable like thisisanarrayvariable
as one liner如果我想将像
thisisanarrayvariable
这样的数组变量打印为一个衬里thisisanarrayvariable
i took the below approach, but i'am not getting any out while the program is hanging我采用了以下方法,但是在程序挂起时我什么都没得到
for ($i=0;$i -le $array.length; $i++)
{ $array[$i] }
for ($i=0;$i -le $array.length; $i++)
{ $array[$i] }
obviuosly, i dont want to glue them together like $array[0]+$array[1]+$array[2]..
显然,我不想像
$array[0]+$array[1]+$array[2]..
那样将它们粘合在一起$array[0]+$array[1]+$array[2]..
Hope i can get a better answer.希望我能得到一个更好的答案。
I'm populating an array variable $array
at some point in my code, for example like below我在代码中的某个时候填充了数组变量
$array
,例如下面的例子
this
is
an
array
varaible
What if, I wanted to print out the array variable like thisisanarrayvariable
as one liner如果我想将像
thisisanarrayvariable
这样的数组变量打印为一个衬里thisisanarrayvariable
i took the below approach, but i'am not getting any out while the program is hanging我采用了以下方法,但是在程序挂起时我什么都没得到
for ($i=0;$i -le $array.length; $i++)
{ $array[$i] }
for ($i=0;$i -le $array.length; $i++)
{ $array[$i] }
obviuosly, i dont want to glue them together like $array[0]+$array[1]+$array[2]..
显然,我不想像
$array[0]+$array[1]+$array[2]..
那样将它们粘合在一起$array[0]+$array[1]+$array[2]..
Hope i can get a better answer.希望我能得到一个更好的答案。
I'm populating an array variable $array
at some point in my code, for example like below我在代码中的某个时候填充了数组变量
$array
,例如下面的例子
this
is
an
array
varaible
What if, I wanted to print out the array variable like thisisanarrayvariable
as one liner如果我想将像
thisisanarrayvariable
这样的数组变量打印为一个衬里thisisanarrayvariable
i took the below approach, but i'am not getting any out while the program is hanging我采用了以下方法,但是在程序挂起时我什么都没得到
for ($i=0;$i -le $array.length; $i++)
{ $array[$i] }
for ($i=0;$i -le $array.length; $i++)
{ $array[$i] }
obviuosly, i dont want to glue them together like $array[0]+$array[1]+$array[2]..
显然,我不想像
$array[0]+$array[1]+$array[2]..
那样将它们粘合在一起$array[0]+$array[1]+$array[2]..
Hope i can get a better answer.希望我能得到一个更好的答案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.