I've had experience with PHP building simple websites and have only
scratched the surface of what it's capable of, so in a sense I'm a newbie.
However the problem I have is that I want to be able to read a file, store
it into a string, and be able to look for patterns in it to extract. I know
what the regex expression is for getting the data, but not familiar with how
to read the string and for each match, store it in an array. I haven't been
able to find any sample code and my php geek buddy is on vacation.
<?php
$string = implode(file("c lasses.txt"));
$string = ereg_replace ("/r|/n", "", $string);
// this is where I have no clue
?>
Regex expression going to be used - "[A-Z]{3,4} [0-9.]{4} [a-zA-Z.
\n\r]*\(([0-9]|Var.)\) [a-zA-Z;,. \n\r-]*"
Also, if you know how to be able to READ a PDF file in PHP let me know.
Cutting and pasting twenty 6.1MB PDFs will get annoying. I'm just trying to
make a script to save me time in the future.
William Holroyd
scratched the surface of what it's capable of, so in a sense I'm a newbie.
However the problem I have is that I want to be able to read a file, store
it into a string, and be able to look for patterns in it to extract. I know
what the regex expression is for getting the data, but not familiar with how
to read the string and for each match, store it in an array. I haven't been
able to find any sample code and my php geek buddy is on vacation.
<?php
$string = implode(file("c lasses.txt"));
$string = ereg_replace ("/r|/n", "", $string);
// this is where I have no clue
?>
Regex expression going to be used - "[A-Z]{3,4} [0-9.]{4} [a-zA-Z.
\n\r]*\(([0-9]|Var.)\) [a-zA-Z;,. \n\r-]*"
Also, if you know how to be able to READ a PDF file in PHP let me know.
Cutting and pasting twenty 6.1MB PDFs will get annoying. I'm just trying to
make a script to save me time in the future.
William Holroyd
Comment