1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

I need help adding spaces between ads

Discussion in 'Co-op Advertising Network' started by iconrate, Dec 7, 2004.

  1. #1
    I've tried a few things but still haven't had any luck placing ads between links (on the coop network).
    <?php
    ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
    include ('ad_network.php');
    echo $ad_network[0],$ad_network[1],$ad_network[2],$ad_network[3],$ad_network[4];
    ?>

    Can someone explain how to add a space between ad_network[0] and ad_network[1] and so on? Thanks :confused:
     
    iconrate, Dec 7, 2004 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    Change the echo line to:
    echo implode (' ', $ad_network);
    PHP:
    This is becoming a popular line of code these days. :)
     
    digitalpoint, Dec 7, 2004 IP
  3. iconrate

    iconrate Well-Known Member

    Messages:
    457
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    138
    #3
    Thanks, works great! :)
     
    iconrate, Dec 7, 2004 IP
  4. expat

    expat Stranger from a far land

    Messages:
    873
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #4
    the echo or print statement in php spews out whatever is between " " before the next ;

    any var like $foo will simply replaced by it's value any html or other text can be included

    So

    echo "@var1&nbsp@var2"; will include a blank

    all html tags are possible but beware if a " is required you need to exclude it by a trailing \

    so align="center" is actually align=\"center"\

    concat works as well
    http://us2.php.net/echo
    M
     
    expat, Dec 7, 2004 IP
    SEbasic likes this.
  5. mudnik

    mudnik Peon

    Messages:
    147
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    This was how I did mine before I saw Shawn's code:
    echo $ad_network[0];
    printf("   ");
    echo $ad_network[1];
    printf("   ");
    echo $ad_network[2];
    printf("   ");
    echo $ad_network[3];
    printf("   ");
    echo $ad_network[4];
    printf("   ");
    I used alt-255 to create the spaces. lol
     
    mudnik, Dec 7, 2004 IP