我想在粗体内容之间添加换行符。
这是列中显示的内容
85025 血细胞计数完全自动和自动 Difrntl Wbc Count82977谷氨酰转酶 Gamma80053 综合代谢Panel81000小便浸棒/片剂试剂非自动 Micrscpy
我已将其更改为<br>,但它不起作用
$subject = ucwords(strtolower($row['myitem']));
echo " <td class='detail'> " . $subject . "</td>\n";
我想在粗体内容之间添加换行符。
这是列中显示的内容
85025 血细胞计数完全自动和自动 Difrntl Wbc Count82977谷氨酰转酶 Gamma80053 综合代谢Panel81000小便浸棒/片剂试剂非自动 Micrscpy
我已将其更改为<br>,但它不起作用
$subject = ucwords(strtolower($row['myitem']));
echo " <td class='detail'> " . $subject . "</td>\n";
这里$row是多个是的数组myitem?数组也是如此$subject,因此您必须遍历数组的每个值$subject
foreach($subject as $key=>$value){
echo '<tr><td class="detail"> ' . $value . '</td></tr>';
}
这里<tr>给你换行符。
如果我正确理解你可能是你正在寻找或者让我知道如果我错了..
这是你想要的吗?
<?php
$subject = "85025 Blood Count Complete Auto&auto Difrntl Wbc Count82977 Glutamyltrase Gamma80053 Comprehensive Metabolic Panel81000 Urinls Dip Stick/tablet Reagnt Non-auto Micrscpy";
$searchStr1 = "Count82977";
$searchStr2 = "Panel81000";
$str1 = str_replace($searchStr1, '<br/>'.$searchStr1.'<br/>', $subject);
$str2 = str_replace($searchStr2, '<br/>'.$searchStr2.'<br/>', $str1);
echo $str2;
?>