Trouble with PHP echo Description

Discussion in 'PHP' started by trueuk, Sep 28, 2012.

  1. #1
    Hey everyone, If anyone has a few mins spare, it would save me last few strands of hair I have left in my head..
    I am having a few problems with an echo problem here is the code below:

    if($approved == "y"){

    echo "<title>".$city." ".$areainput."</title>";
    $areainput1 = $area[2];

    ---------------

    This above all works fine.. But I want to add a meta description like below?

    --------------
    if($approved == "y"){
    echo "<title>".$city." ".$areainput."</title>";
    echo "<meta name="description" content="html content here (now php code ".$city.") and again html here" />;

    $areainput1 = $area[2];


    ---------------

    How do I correctly write this code?

    Kind Regards

    Lee
     
    trueuk, Sep 28, 2012 IP
  2. plussy

    plussy Peon

    Messages:
    152
    Likes Received:
    5
    Best Answers:
    9
    Trophy Points:
    0
    #2
    
    if($approved == 'y'){
    echo '<title>'.$city.' '.$areainput.'</title>';
    echo '<meta name="description" content="html content here (now php code '.$city.') and again html here" />';
    
    $areainput1 = $area[2];
    
    Code (markup):
     
    plussy, Sep 28, 2012 IP
  3. trueuk

    trueuk Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    "You my friend are a bloody Diamond.. You have saved me from complete hairloss!!"

    Cheers my friend :)

    All the very best and a massive thank you

    Lee
     
    trueuk, Sep 28, 2012 IP