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

ECC6 - Single sign-on
We are in the process of upgrading to ECC 6 which will support single sign on with user passwords al

Getting a variable to work in function params
I have this fuction which is inside a class:

Code: public static function generateEmbedCode($

upload image name with extension using php
hi frds..

<input id="file1" type="file" name="file[]" &a

Custom CMS
This is a big custom CMS script I'd like to develop and would like some help atleast figuring out wh

header redirect problems? please help
Ok i am making a site that generates youtube thumbnails and i am generating an image that displays 1

Scrolling news bar and MySQL
I am not sure if this is the correct forum to post this on. If not, I apologize. I am still pretty

ScriptManager History and Opera Issue
I am having an issue in opera with the ScriptManager. I have a ScriptManager on a page with history

Multiple websites question.
Hi, does php have any functionality that enables a programmer to extract information from a website

Xacute search within SQL results
I have a query that is pulling data, and I want to return a specific value from the results of that

Echoing a Variable from a Object
How do I get a variable from the new User Class to echo out in this clasS?

class MyApp
{

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