我的代码从文本文件中获取随机行: 更新代码:
<?php
$text = file_get_contents('proxy');
$textArray = explode("\n",$text);
$randArrayIndexNum = array_rand($textArray);
$randPhrase = $textArray[$randArrayIndexNum];?>
<html>
<body>
<?php
echo trim($randPhrase,"<br>");
?>
</body>
</html>
但随机文字最后有空格:
89.38.146.26:8080 <- here
如何删除它?