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!

342 Like 31 Dislike
Previous php-forum Next php-forum
Other php-forum

Online Event Ticket Sales
Has anyone wrote a script for online tickets sales?

I have been googling and found lots of th

rdns with php
I am trying to build a script that will show all of the different domains that are hosted on the sam

How to update this array?
I am saving a string that looks this: username1, username2, username3...
into a single cell in a

How to grab certain words ??
I am working with this API

Returns JSON.
curl http://letsbetrends.com/api/current_trends

form variables from database help.
Hi all,

I would like to have a form that gives you options based on the results of an mysql q

Multiple while loops
I have several DB queries that I know should be returning results and aren't. I have a feeling it ha

Syntax Help
I'm trying to make a form that edits a php file which contains config settings. I'm using strings t

Buggy registration system
Hey, I just started scripting in PHP, and I ran into a few problems.
Code: <?php
includ

Run function every 5 mins ??
I have a function PostMessage()

How can I run it every 5 mins ??

Help: calling function
Hi,
Is it possible to call a php function on page close?
If yes, could you explain how and whe

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