Selecting array in PHP

Discussion in 'PHP' started by designcentral, Feb 4, 2011.

  1. #1
    Hi there,

    I'm trying to fetch an array in PHP where the title within that array is equal to something I specify.

    
    $title = "This is a title.";
    
    $post = $xml->entry;
    
    //Title within array is stored like this
    $xml->entry->title;
    
    PHP:
    How can I make the $post variable fetch the entry that has a title within it of $title.

    TIA!
     
    designcentral, Feb 4, 2011 IP
  2. G3n3s!s

    G3n3s!s Active Member

    Messages:
    325
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    80
    #2
    $title = "this_is_a_title";
    $content = "this is a content";
    $post = array($title => $content);

    Hope you thought this
     
    G3n3s!s, Feb 4, 2011 IP