Jump to content

Search the Community

Showing results for tags 'match array keys'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Here are two example of the format of the Arrays, full code and array content in my code below. ARRAY 1 Array ( [version] => 1.0 [injuries] => Array ( [timestamp] => 1377702112 [week] => 1 [injury] => Array ( [0] => Array ( [status] => Questionable [id] => 10009 [details] => Shoulder ) [1] => Array ( [status] => Questionable [id] => 10012 [details] => Ankle ) ARRAY 2 Array ( [version] => 1.0 [players] => Array ( [timestamp] => 1377676937 [player] => Array ( [0] => Array ( [position] => TMDL [name] => Bills, Buffalo [id] => 0251 [team] => BUF ) [1] => Array ( [position] => TMDL [name] => Colts, Indianapolis [id] => 10009 [team] => IND ) What I need to do is sort through both Arrays and finding matching values for the ID key. I need to then combine the values of both arrays into one array so I can print it out on screen. Here is how far I have gotten on this problem: <?php function injuries_report() { //Get json files $injuryData = file_get_contents('http://football.myfantasyleague.com/2013/export?TYPE=injuries&L=&W=&JSON=1&callback='); $playerData = file_get_contents('http://football.myfantasyleague.com/2013/export?TYPE=players&L=&W=&JSON=1'); //format json data into an array $obj1 = json_decode($injuryData, true); $obj2 = json_decode($playerData, true); //return print_r($obj1); //print obj1 to see output return print_r($obj2); //print obj2 to see output } ?> <!--get injuries report --> <pre><?php injuries_report(); ?></pre>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.