Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/230.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Php中更改新行上的变量值_Php_List - Fatal编程技术网

如何在Php中更改新行上的变量值

如何在Php中更改新行上的变量值,php,list,Php,List,这里有一行变量值。您可以在下面的php源代码中看到 <?php $list = "03343922581 03136011388 03142181356 03471819024 03003973577"; //Please tell me the php code ?> 要在html页面中显示结果,请根据需要使用: $new_list = str_replace(" ","\n",$list); echo nl2br($new_list); 我想你需要回显它…回显nl2br

这里有一行变量值。您可以在下面的php源代码中看到

<?php

$list = "03343922581 03136011388 03142181356 03471819024 03003973577";

//Please tell me the php code

?>

要在html页面中显示结果,请根据需要使用:

$new_list = str_replace(" ","\n",$list);
echo nl2br($new_list);

我想你需要回显它…回显nl2br$列表;我已经澄清了我的问题描述。请帮助我MorganFreeFarm,Andreas,u_Mulder亲爱的Majid如果我想在表格的新行中放置每一个新行值,我该如何做。这是一个非常普遍的问题。你可以读这个[还有这个][
$new_list = str_replace(" ","\n",$list);
echo nl2br($new_list);