Gustav Wiberg wrote:
<?php
$lines = file('export/nhExportVarupiraten.txt');
// Loop through our array, show HTML source as HTML source; and line
numbers too.
foreach ($lines as $line_num => $line) {
echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br />\n";
if ($line_num > 0 ) {
$getName = explode('<>', $line);
$pattern = "/ID=([0-9]*)\</";
$subject = $line;
$idNumber = preg_split($pattern, $subject);
// instead of preg_split, use preg_match
$idNumber = preg_match($pattern, $subject, $matches);
// your ID number is now in $matches[1]
echo "NAME = " . $getName[2] . " has ID number=$idNumber[0]<br>";
}
//require("phpfunctions/opendb.php");
//$sql = "UPDATE beskrivandeVarunamn=" . safeQuote($bNamn) . " WHERER"
//mysql_close();
}
?>
--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php