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

Problem with "dynamic" index page
Hi. I have one question. In my index.php page I have this kind of code:
Code: // listaa sivut

switch form actions? not working
i want on submit to go to different pages according to the CatID

Code: <?php $CatID=$_

Variable Clash
In the past I've had variables clash. For example:

Code: <?php
$c = 5;
$ca

get multiple rows
Hi I want to get multiple rows from a db

I am using this for the db query
Code: public

need help in creating captcha
hi i have a problem creating captcha system. i create some basic script for image displaying but it

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

Get keys and values from an array
Hellow,

I have an array $Data with keys and values. With a foreach I can display all the valu

WORDPRESS - Multiple Loops Only Going to One Post?
I have various pages with multiple loops and i need them to be individual to all other categories.

Protecting forms
Alright, I want to protect some forms of mine from SQL Injections, because I had someone earlier spa

search function
HI guys,

if anyone could point us in the right direction of how to do this, or provide some t

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