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

Am I setting up my sites oldschool?
Ok,

When I create a site I open a basic template that I have created that consists of a css f

SQL Query/echo not working
Hey all,

I'm trying to run (what I thought) was a simple operation and it isn't working. I h

Require select-option functionality in Module Pool Programming
Hi Gurus,

I am doing a development by Module Pool on Warehouse Management. For that devel

Error in write byte array into document in SM58
Hi Gurus,

Getting the following error status in Transactional RFC (SM58) ..... *Error i

How would I convert this into code using an if statement?
ES equals exam score m equals $mean s equals $total. I already coded my mean and total so I'm not g

I have a parse error in this query help..
Code: $query1="INSERT INTO `rating` (`item_name`, `rating`, `ip_address`, `date_rated`) VALUES

MySQL issue
I am taking sentences through a form on page. Then checking some condition and trying to insert them

socket communication between c++/java and sending image
hi,

i have a class in c++ called win32_sockserver which creates socket to java. i am trying

remove innitial

and

tags
i am using tiny_mce as a text editor for my CMS.
buy now the problem is it add <p>

php and downloading
I want to use a php script to create two files. Then I want it to redirect (or whatever) to have tho

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