Jump to content

Search the Community

Showing results for tags 'array_merge'.

  • 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 2 results

  1. I'm sure this is something simple that I'm just overlooking right now, but it's got me very frustrated and I just want a quick fix... I have 2 arrays, $data_old and $totals_old Let's say each looks like this (with the 123456 being different for both): Array ( [2014] => Array ( [123456] => Array ( [EMPS] => 114350 ) ) ) When I merge the two, I get something like this: Array ( [2014] => Array ( [0] => Array ( [123456] => Array ( [EMPS] => 114350 ) ) [1] => Array ( [60] => Array ( [EMPS] => 1470 ) ) ) ) How can I avoid the [0] and [1] and just have those be [123456] and [60], without referencing the 123456 and 60?
  2. Hi phpfreak-ers, $BigArray[] = array('url' => 'www.example.com', 'referer' => 'refer1'); $BigArray[] = array('url' => 'www.demo.com', 'referer' => 'refer1'); $SmallArray[] = array('url' => 'www.example.com', 'referer' => 'refer2'); Basically I want to compare the two example arrays (above) and if a duplicate 'url' is found then I'd like to merge the 'referer' values in $BigArray otherwise add as an additional record. So I should be left with: Not syntax just used to explain my objective $BigArray url='www.example.com', 'referer' = 'refer1refer2'. $BigArray url='www.demo.com', 'referer' = 'refer1'. I've tried a day and a half worth of approaches and can't get it working. Thanks for your help in advance! Matt
×
×
  • 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.