<?php
$file = file_get_contents("http://www.mywebsite.net/folder/indexhtml.asp");
preg_match_all('~<td width="23%" height="23" align="right">(.*?)</td>~is',$file, $matches5);
print implode("\n", $matches5[0]); //This prints out (Page: 889) on website ?>
ブラケットと「Page」という単語を「Number」という文字列から、matches5 変数と呼ばれる文字列から削除しようとしています。
このコードを下で使用するたびに、空白が表示され、非常に混乱します。PHP 2番目のコードに不慣れな人を助けてください
<?php
$file = file_get_contents("http://www.mywebsite.net/folder/indexhtml.asp");
preg_match_all('~<td width="23%" height="23" align="right">(.*?)</td>~is',$file, $matches5);
$result = preg_replace('/(?<=^| ).(?=$| )/sm', '', $matches5);
print implode("\n", $result[0]);
?>