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

Did you know?Explore Trending and Topic pages for more stories like this.
&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

use an array from 1 class in a second class
I have a class that adds data to an array

Then I have a second class and I need to check if t

Multiple upload and Resize
I would like some help on my script I have the for my index.php

////

<html&

problem with query error
First Thanks to those who helped me on my previous posts, and the following code i'm using is not mi

modifying query string with no page refresh
Hi everybody,
I've tried to get info about my problem all over the internet but i didn't find out

Securing a user input - need some confirmation
Hello All,

I am in the process of recoding a large proportion of an e-commerce site, one of t

Help me with some material on Open Text Overview.
Hi Experts,
Please help me out with some material on Open Text. I have been supporting AP Workf

Email Script does not reach destination
Hey Guys look at this code snippet :
Code:
//read a line from the file

$myFile = "

Validation
Hello

I know this is a really vag question.

I need to have a input field on a form th

Are sessions secure at all?..
I haven't really gotten into yet, but I was just thinking of something weird..

Lets say you h

data type in column definition
Hi,
I create a table with column called "Direction of Travel code ".
The travel codes in 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