I am having trouble with getting the values I want returned. Please help if you can. This is the first time I have done anythiing with regex.
<?php
$filename = "c:\\program files\\apache group\\apache\\htdocs\\regex.txt";
$fd = fopen($filename, "r");
$fstring = fread($fd, filesize($filename));
fclose($fd);
$line = explode("\n", $fstring);
$array = preg_grep('/\\d\\d/', $line);
foreach ($array as $get)
{
print ("$get<br>");
}
?>
regex.txt:
11 theew
12 the56
13 wer12
14 wer5
Values I get returned:
11 theew
12 the56
13 wer12
14 wer5
Values I want:
11
12
13
14
Thanks in advance,
Wil