MoonPoint Support Logo

 

Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals



Advanced Search
June
Sun Mon Tue Wed Thu Fri Sat
         
11
2018
Months
Jun


Mon, Jun 11, 2018 10:43 pm

Finding text within lines in a file with PHP

For a weekly status report, I need to determine the number of work requests that are approved and awaiting implementation. The list of requests in that state is contained in a webpage that contains other information, including requests that are in various other states, such as those awaiting approval. I normally download the webpage containing the information to run scripts against it to extract other information from the page, so I decided to create a PHP script that would display just the list of requests awaiting implementation and produce a count of those requests in that state. On the source webpage the line on the page that marks the start of the section of the page containing the requests that are approved and awaiting implementation contains the text "Requests Waiting Implementation". The HTML code on the page that marks the end of that section contains and ending div tag. So I created the two PHP variables below to hold the two strings I need to search for within the file.

$startString = "Requests Waiting Implementation";
$endString = "</div>";

[ More Info ]

[/languages/php] permanent link

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo