473,811 Members | 3,264 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Get data between HTML Tags

I'm looking to get the baseball score between the html tags on yahoo and
create my own rows with just the data.

So far I have this code
-----------------------------------------------------------
$data = file_get_conten ts('http://sports.yahoo.co m/');
list(, $data_split) = explode('<td width="50%" class="yspscore s">', $data,
2);
list($data2, ) = explode('</a></td>', $data_split, 2);
$data2 = strip_tags($dat a2);
echo $data2;
-------------------------------------------------------

It gives me all the results but I want to do a loop that will find the first
row of scores create a new row and put the data in the new row then find the
next row of scores create another new row and insert the data and continue
that pattern to the end.

Thanks

Sep 5 '05 #1
1 2276
I forgot to mention my host is using PHP 4.3.10

Thanks
"Optonline" <so*****@aol.co m> wrote in message
news:qt******** **********@fe10 .lga...
I'm looking to get the baseball score between the html tags on yahoo and
create my own rows with just the data.

So far I have this code
-----------------------------------------------------------
$data = file_get_conten ts('http://sports.yahoo.co m/');
list(, $data_split) = explode('<td width="50%" class="yspscore s">', $data,
2);
list($data2, ) = explode('</a></td>', $data_split, 2);
$data2 = strip_tags($dat a2);
echo $data2;
-------------------------------------------------------

It gives me all the results but I want to do a loop that will find the
first
row of scores create a new row and put the data in the new row then find
the
next row of scores create another new row and insert the data and continue
that pattern to the end.

Thanks

Sep 5 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1421
by: Ken in Melbourne Australia | last post by:
For some Open Source (GPL licensed) programs that I am working on, I am trying to create some PHP routines for data handling with good security. The routines I have created for this are given below and I would like these reviewed for security problems or other problems that they may have. My requirements are as follows:
1
1808
by: Robert V | last post by:
Hi all, another area I could use some help with is changing submitted data based on the data conditions ... I will elaborate. I have a form textarea where a user can type in some text. This text is sent to a perl script that eventually will send that data to someone by email in HTML format. Here is where I need some help. If a user was to type in a web address www.mysite.com etc, in the text box, I would like my script to detect web...
1
1856
by: Joe Conlin | last post by:
I am truncating data from an SQL database and have a script that populates a cell. The problem that I have is I have HTML tags in my database so if the data gets truncated in the middle of a tag, then my page goes...well, you know. What I am looking for is a way that I can contain ANY data (i.e. characters, tags, etc.) directly in that cell. So...If I have a <table> tag it will not throw off the rest of the table tags throughout my page. ...
31
4163
by: Greg Scharlemann | last post by:
Given some recent success on a simple form validation (mainly due to the kind folks in this forum), I've tried to tackle something a bit more difficult. I'm pulling data down from a database and populating a simple table. I'd like the table to contain 10 entries per page and have the option for the user to scroll through the pages of data without having to go back to refresh the page (I've already pulled all the info I need from the...
34
1893
by: glomde | last post by:
i I would like to extend python so that you could create hiercical tree structures (XML, HTML etc) easier and that resulting code would be more readable than how you write today with packages like elementtree and xist. I dont want to replace the packages but the packages could be used with the new operators and the resulting IMHO is much more readable. The syntax i would like is something like the below:
13
4251
by: DH | last post by:
Hi, I'm trying to strip the html and other useless junk from a html page.. Id like to create something like an automated text editor, where it takes the keywords from a txt file and removes them from the html page (replace the words in the html page with blank space) I'm new to python and could use a little push in the right direction, any ideas on how to implement this? Thanks!
1
1894
by: Tor Inge Rislaa | last post by:
Adding HTML tags to data from SQL server When dragging a table on to a web form in an ASP.NET 2.0 application, the connection is established and the data is displayed in a DataGrid. Is it possible to manipulate the selected data before it is displayed as HTML data. E.g adding some HTML tags to the value of a datafield.
7
2950
by: zdravko.monov | last post by:
Hi there! I need a C++ library that can organize and write scientific (and numerical overall) data in tables. I have been fighting with std::ofstream and plain ASCII files, but it is difficult to position columns by an offset, impossible to draw table borders etc. I am currently thinking of a class that is able to write to an html file, e.g. As far as I know, html offers much better text (and table) layout. And the format is portable!...
6
2551
by: Shawn | last post by:
Hello: I have the following code in a PHP file. An HTML form passes user comment data to the PHP, which then appends the user comments to the end of the HTML file on which the form is located. This PHP code works: the HTML file with added comments displays correctly in my browser. However, appending text to the very end of the HTML file creates what is, strictly speaking, invalid code. I am looking for a way to tell PHP to write data to...
3
5439
by: IT Couple | last post by:
Hi In the past I have used HTML tags to generate HTML emails, now I want to store the data with HTML tags but display the data on a report. Is there a control that is able to undestand HTML tags and apply proper formatting. This will be simple bold, Italic, Underline Many thanks in advance. Emil
0
9605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10647
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10398
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10133
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9204
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6889
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5554
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4339
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3865
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.