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

Need help with PHP/MySQL drop down menu
I need help on how I can implement a drop down menu which queries mysql database and output the avai

Problem with a select distinct
I have a problema with a select distinct, I have the next sql:

select distinct a,b,c,d fr

Help With Showing Users On the Index Page
Ive got this code which works just how i want it to.

Code: <?
$timenow=time();

Apart from cron
I need to run a php file every one hour. Is there any other solution apart from cron job?

filesize() returns 0
I have a socket program that runs in an infinite loop, listening for connections, in this socket I h

how to use two buttons with php
hi i have one form. there are three fields which are to be filled by the user. and then there are tw

Namespace Problem
I'm having problem with a section of code with a variable namespace.

This code works fine:

Setting/Modify Headers using mail() function
I have a question about setting email headers when using mail() in a php script.

When I send

timed header image rotation
I have a joomla site and I was trying to setup a rotating image based on timing NOT just refreshing

making web pages for accounts
Hello, I would like to make pages for accounts on my website im making (its not a real website..im j

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