Insert Parameter into array's string?

Discussion in 'PHP' started by artboy, Aug 15, 2009.

  1. #1
    I'm just starting to learn php and am trying to add a parameter $full_key_word into the string below. I'm wanting $full_key_word to replace "keyword" in the string. I've tried lots of things and I'm stumped. Any ideas?

    $rssFeeds = array(
    0 => 'http://blogsearch.google.com/blogsearch_feeds?hl=en&q=keyword&ie=utf-8&num=10&output=rss',
    );
     
    artboy, Aug 15, 2009 IP
  2. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #2
    
    $rssFeeds = array(
    0 => 'http://blogsearch.google.com/blogsearch_feeds?hl=en&q=' . $full_key_word . '&ie=utf-8&num=10&output=rss',
    ); 
    
    or
    
    $rssFeeds = array(
    0 => "http://blogsearch.google.com/blogsearch_feeds?hl=en&q=$full_key_word&ie=utf-8&num=10&output=rss",
    ); 
    
    PHP:
    (notice the difference in quotes)
     
    premiumscripts, Aug 16, 2009 IP