display an external web page  partially  (regex-to-end)

Posted on 2009-05-22
Medium Priority
Last Modified: 2012-05-07
Question by:lucavilla

Accepted Solution

musicmasteria earned 1500 total points
ID: 24452558
what would the "specified regex" be? Just a string?

If it is, something like this could work:
$url = 'http://example.com/index.html';
$content = file_get_contents($url);
if ($content=='FALSE'){
die("Failed to open the url: $url");
$begin_string = 'a specified regex here';
$beginpos = strpos($content, $begin_string);
$after = substr($content, ($beginpos+strlen($beginpos)));
echo $after;

Open in new window


Author Closing Comment

ID: 31584435
string instead than regular expression but it's sufficient this time

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Article by: Tammy
MySQLTuner is a script written in Perl that allows you to review a MySQL installation quickly and make adjustments to increase performance and stability. The current configuration variables and status data is retrieved and presented in a brief forma…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Six Sigma Control Plans

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question