我有以下代码。
$var1 = 'This is line1
This is line2
This is line3';
$var_arr = explode("\n", $var1); // or preg_split("/\n/", $var1); same
echo '<ul type = "disc" class="deal_data" >';
foreach($var_arr as $var1)
{
echo '<li><p>'.$var1.'</p></li>';
}
echo '</ul>';
echo 'String Length:'.strlen($var_arr[1]);
它的输出是:
第二个和第四个列表项如何获得不同于零的长度?