Seperate team from score


Posted on 16th Feb 2014 07:03 pm by admin

I am writing a site that does a NFL Pick 'em type application and I have a feed that gives me the scores of the NFL games every week I have it split apart down to each game two teams and a score directly after it...

Here is what it is stripping the info from to begin with

&nfl_s_left1=Houston%20at%20Buffalo%20(1:00%20PM%20ET)

Here is the code:

Code: [Select]foreach($content_array as $content) {
if (strpos($content, "_left")) {
$count=0;
$equalpos = strpos($content, "=");
$end = strlen($content);
$title = substr($content, ($equalpos+1), $end);
$title = str_replace("^", "", $title);
$title = str_replace("%20%20%20", "
",$title);
$title = str_replace("%20", " ", $title);
$game[$i]=$title;
$scorearray[$i]["title"] = $title;
$i++;
}
}

Here is an example of what it looks like

here is what it looks like after the game
Houston 31 at Buffalo 30 (Final)

And here is what it looks like before the game
Houston at Buffalo (1:00 PM ET)

The information that I need is team_home, team_home_score, team_away, team_away_score, game_status(Whether it is finished or what time the game is).

Any ideas or anything would be great!

No comments posted yet

Your Answer:

Login to answer
342 Like 31 Dislike
Previous forums Next forums
Other forums

More pug propaganda.
http://www.youtube.com/watch?v=8Kkrmubsgf8

The commercial is definitely worth watching pug aw

Is there a function ... auto send IP
Is there some function that can be sent to a ddns service that returns the ip address of a ddns forw

Losing 'page' data
I have this code that allows me to update my database. But after updating, I lose the $_GET['page']

PHP Include not working
The website is http://www.grlistingservices.com

The code block is as follows:

<

What are causes of a connection-timeout with fopen()?
Hello! Here is the situation: The server I host my website on just upgraded it's PHP build from 4.4.

PHP submit form script causing blank page
Im trying to submit a form using this script, however nothing shows up on the page, does anyone know

help with contest script
I would like to code a contest script to my site but i don't know how. Could someone just give me pu

Help with php code
Hello, can anyone tell me why this php word trap fails to work,
and the trigger words get blow r

str_replace help
Hey there,

I'm a PHP newb, I'm having troubles with the str_replace function. I want to clean

Pagination
Hi All,

I think I'm finally getting somewhere with pagination!

I can now submit a quer

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