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

Two fgetcsv related questions ;D
First of im trying to get a file from a merchants server but the directory is protected, I know the

Error querying database.
I get the above error when trying to insert some values to a datatable.
Here's the code :

Unexpected T_Variable ?
Hi all,
I dont really know what I am doing!! I know I'm doing something wrong, and I know its on

MFC GUI Programming
I am working on a project right now that requires me to create a MFC Windows GUI. Basically it need

is_dir() problem
Hello,

I'm buidling a php scripts that dynamically get's subfolders from a specific folder.

creating a 1 to 100 in a table
hi guys I am a newb in php need some help.

I have a table with 1 column and 100 rows and in

how to insert value
I am having file bookissueadd.php..... in which i am having tag

<td height="21&q

Function to extract email attachments using PHP IMAP
function extract_attachments($connection, $message_number) {

$attachments = array();

Dealing with code in db query
I am dealing with C code and I need to make sure it is encoded some how to ensure its integrity and

a very simple php header question (sorry!)
Firstly...I do apologise if this annoys anyone....a header error

I'm do not know php &

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