:
$result = preg_replace('~\R?(?:[0-9A-F]{2}\h+)+~', '', $data);
$result = explode('..', rtrim($result, '.'));
:
\R?
(?:
[0-9A-F]{2}
\h+
)+
, , . .
, ( ) 48 , :
$result = preg_replace('~(?:^|\R).{48}~', '', $data);
, , (, 16 * 3 → 48 ), $data
.
ini_set("auto_detect_line_endings", true);
$data = '';
$handle = @fopen("tags.txt", "r");
if ($handle) {
while (($buffer = fgets($handle, 128)) !== false) {
$data .= substr($buffer, 48, -1);
}
if (!feof($handle)) {
echo "Error: fgets() has failed\n";
}
fclose($handle);
} else {
echo "Error opening the file\n";
}
$result = explode ('..', rtrim($data, '.'));
. ( \r\n
), substr()
-2
. , , .