Hi!
PHP Code:
<?php
$test = '<a name="newsitem1016416793,68681,"></a>
Subject1:This is the text input for number one.<br><br>
<a name="newsitem1016415492,28443,"></a>
Subject2:This is the text input for number two.<br><br>
<a name="newsitem1016337268,49011,"></a>
Subject3:This is the text input for number three.<br>';
$test1 = preg_replace("/<a[^>]*>(.*)<\/a>/siU", "", $test);
$test1 = preg_replace("/Subject\d+/", "*news*", $test);
echo $test1;
$fp = @fopen("./news_clean.txt", "w");
flock($fp, LOCK_EX);
fwrite($fp, $test1);
flock($fp, LOCK_UN);
fclose($fp);
?>
The first regexp removes the <a ... line and the second replaces subject with news
And output will be:
Code:
*news*:This is the text input for number one.
*news*:This is the text input for number two.
*news*:This is the text input for number three.
Bookmarks