I am working on a site that requires me to pull a small bit of information from another page of my site, and have figured it out somewhat. Here’s my code so far. I set up a simple page as an example of the page I am pulling info from.
[CODE]<?php
$data = file_get_contents(‘http://www.egnited.net/site.php/’);
$regex = ‘/Star Wars (.+?) A New Hope/’;
preg_match($regex,$data,$match);
echo $match[1];
?>
This code pulls the text between “Star Wars” and “A New Hope” (the text being “Episode IV:”) to the page which I have the above code:
[url]http://egnited.net/test.php
My question is, how exactly would I need to alter my code to include:
1. The entire line, “Star Wars Episode IV: A New Hope”;
and2. Multiple lines (ie, from “Star Wars” down to “Jaws”?
Can someone please show me what changes I need to make to make the above happen?
Thanks for any help, I’m sorry if this doesn’t make sense.