reading partial code from external site


Posted on 16th Feb 2014 07:03 pm by admin

Hi,

I am trying to write a script for my website to get an article from an external website. The external website has the article in a set of tags <roottag> & </roottag>

Did you know?Explore Trending and Topic pages for more stories like this.
The code I am using is
Code: $page = file_get_contents($url);
preg_match_all("/<roottag>.+</roottag>/", $page, $matches);
print_r($matches);
when this code runs the below is output: -

Array ( => Array ( ) )
I've not used this function in php and am a bit stuck! so any help is really appreciated
No comments posted yet

Your Answer:

Login to answer
313 Like 51 Dislike
Previous forums Next forums
Other forums

GET * FROM _____ Except?
I have a site that is for stock photography.

This section of the code calls images to display

building a function with multiple outputs
I want to build a function that has multiple outputs.

I know but am not to sure how I should

Oracle11g Patch issue
Hi all,

I'm getting the following error while installing Oracle11g Patch 11.1.0.7.0 on IBM-AI

MS are the best!!!
Visit http://www.microsoft.com/australia/windows/default.aspx?h=watch-a-demo and click the massive '

PHP Script runs on CLI but not through web browser
I am running into an issue that I just can't seem to find the answer to. I have a Windows Server 200

server trace logs
could any one tell me from where do i get error logs in xMII??I want to check the reason for dtabase

Passing variables with pagination - iterating through unique id per link
Hi everyone,
I have seen a few topics like this one. Still cant find the specific thing, so I am

Problem with php's rename function
So, i'm having a problem with the php rename function. Basically my script 'delete_user.php' attempt

close site for maintenance
i get a tutorial, saying the following code can put our site offline, and only the developer can vie

Problems with array
This code is the last lines in an upload script that uploads 4 images at the same time and writes th

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash