+ Reply to Thread
Results 1 to 2 of 2

Thread: php function

  1. #1
    kimwong99956 is offline x10Hosting Member kimwong99956 is an unknown quantity at this point
    Join Date
    May 2011
    Posts
    5

    php function

    if I have an array like this $a1 = array('first'=>'one','second'=>'two, 'third'=>'three');

    I want to produce from $a1 this array

    $a2 = array('The key is first and the value is one', 'the key is second and the value is two', 'the key is third and the value is three');

    is this possible using EXISTING php functions? I know I can write my own function to do this, and it's quite simple, but before I do that I want to first make sure that there aren't any php functions that can already do this.

    thanks

    Kim

  2. #2
    essellar's Avatar
    essellar is offline Community Advocate essellar has a spectacular aura about
    Join Date
    Feb 2010
    Location
    Toronto, Ontario, CA
    Posts
    1,153

    Re: php function

    No, there is no natural_language_serialize($array_name, "english") -- you'll need to use a foreach like everybody else.
    “Beware of bugs in the above code; I have only proved it correct, not tried it.” --Donald Knuth
    "It was as if its architects were given a perfectly good hammer and gleefully replied, 'neat! With this hammer, we can build a tool that can pound in nails.'" -- Alex Papadimoulis (on TheDailyWTF.com)

+ Reply to Thread

Similar Threads

  1. PHP sendmail function
    By xfm_rox in forum Free Hosting
    Replies: 11
    Last Post: 09-22-2010, 03:13 PM
  2. PHP Max Function Help
    By diabolo in forum Programming Help
    Replies: 2
    Last Post: 07-22-2009, 09:12 PM
  3. Help with php function
    By zyreena in forum Programming Help
    Replies: 8
    Last Post: 05-13-2009, 10:17 AM
  4. ADD function in PHP?
    By PSP-Heaven in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 05-27-2006, 01:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers