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>

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

UDP server recvfrom() always returns -1? :(
Hello all,
I am getting a very strange error in my code :( I am writing a server application in C

array_combine() error
getting an "Warning: array_combine() [function.array-combine]: Both parameters should have an e

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

Solution to the FindControl problem
I have seen may posts about having problems with the FindControl method. Most seem to come about bec

image upload script not working with png
The basic process of this php code is to take the submitted file, convert it to a small JPG thumbnai

SQL query not working well
Hi,
I made a small table with 5 rows and want to make them an sql consult using rownum

How to copy a part of a vector in a raw memory
Hi,

How can I copy a part of a vector into a memory:

1
2
3
4
5

listing help
Hi,

at first, great new design!!! I like it,

i got a problem,

I want to list so

Help with search.php
Hello All

I need the search engine on a site I am building at the moment to display the searc

sql problems
I am having a small problem with my sql statement. it is inserting into 4 of the fields.

fie

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