[advanced search]
Results from the most recent live auction are here.
15 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Go Back   NamePros.Com > Design and Development > Programming
User Name
Password

Old 04-10-2008, 08:33 AM   · #1
baris22
NamePros Member
 
Trader Rating: (0)
Join Date: Jan 2007
Posts: 64
NP$: 0.00 (Donate)
baris22 is an unknown quantity at this point
How can i put breaks beetween images?

Hello,

I have got this code

PHP Code:
$imageArray = array('jpg','gif','png');
$urls  = explode(';',$row['links']);
foreach(
$urls as $url)
{
if(
in_array(substr($url,(-3)),$imageArray)){
echo
'<img src="'.$url.'" />';
}
}


Images are showing one next to another one. What can i do to show them one on another one?

Thanks


Please register or log-in into NamePros to hide ads
__________________

Rapidme
(rapidshare application)
baris22 is offline   Reply With Quote
Old 04-10-2008, 08:41 AM   · #2
SecondVersion
while ($awake){ code(); }
 
SecondVersion's Avatar
 


Name: Eric
Location: Kentucky
Trader Rating: (142)
Join Date: Mar 2005
Posts: 4,261
NP$: 541.00 (Donate)
SecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond repute
Member of the Month
MOTM September 2005 Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Cancer Alzheimer's Protect Our Planet
PHP Code:
<?php

// If you want each image on it's own line
$imageArray = array('jpg', 'gif', 'png');

$urls  = explode(';', $row['links']);

foreach (
$urls AS $url)
{
    if (
in_array(substr($url, -3), $imageArray))
    {
        echo
"<img src=\"$url\" /><br /><br />";
    }
}

// OR - just a space between each image and they are on the same line
$imageArray = array('jpg', 'gif', 'png');

$urls  = explode(';', $row['links']);

foreach (
$urls AS $url)
{
    if (
in_array(substr($url, -3), $imageArray))
    {
        echo
"<img src=\"$url\" /> &nbsp; ";
    }
}

?>
__________________

SecondVersion.com - The Personal Blog of SecondVersion
Domain Name Portfolio - Get your free copy. - Version 1.0.3 now available!!
SecondVersion is offline   Reply With Quote
Old 04-10-2008, 08:50 AM   · #3
baris22
NamePros Member
 
Trader Rating: (0)
Join Date: Jan 2007
Posts: 64
NP$: 0.00 (Donate)
baris22 is an unknown quantity at this point
Thank you very much


Originally Posted by SecondVersion
PHP Code:
<?php

// If you want each image on it's own line
$imageArray = array('jpg', 'gif', 'png');

$urls  = explode(';', $row['links']);

foreach (
$urls AS $url)
{
    if (
in_array(substr($url, -3), $imageArray))
    {
        echo
"<img src=\"$url\" /><br /><br />";
    }
}

// OR - just a space between each image and they are on the same line
$imageArray = array('jpg', 'gif', 'png');

$urls  = explode(';', $row['links']);

foreach (
$urls AS $url)
{
    if (
in_array(substr($url, -3), $imageArray))
    {
        echo
"<img src=\"$url\" /> &nbsp; ";
    }
}

?>

__________________

Rapidme
(rapidshare application)
baris22 is offline   Reply With Quote
Old 04-10-2008, 07:26 PM   · #4
-PS-
NamePros Regular
 
-PS-'s Avatar
 
Name: Justin
Location: Sydney
Trader Rating: (17)
Join Date: Jun 2006
Posts: 251
NP$: 5.95 (Donate)
-PS- will become famous soon enough-PS- will become famous soon enough
another way, would to be put something like style="padding-right:5px;" in the image tag, that way you can adjust the spacing in between the images at will.
-PS- is offline   Reply With Quote
Old 04-13-2008, 11:03 AM   · #5
trlg
NamePros Member
 
Trader Rating: (0)
Join Date: May 2007
Posts: 46
NP$: 0.00 (Donate)
trlg is an unknown quantity at this point
actually i think one <br /> should be good enough?

Originally Posted by SecondVersion
PHP Code:
<?php

// If you want each image on it's own line
$imageArray = array('jpg', 'gif', 'png');

$urls  = explode(';', $row['links']);

foreach (
$urls AS $url)
{
    if (
in_array(substr($url, -3), $imageArray))
    {
        echo
"<img src=\"$url\" /><br /><br />";
    }
}

// OR - just a space between each image and they are on the same line
$imageArray = array('jpg', 'gif', 'png');

$urls  = explode(';', $row['links']);

foreach (
$urls AS $url)
{
    if (
in_array(substr($url, -3), $imageArray))
    {
        echo
"<img src=\"$url\" /> &nbsp; ";
    }
}

?>

trlg is offline   Reply With Quote
Old 04-13-2008, 11:10 AM   · #6
SecondVersion
while ($awake){ code(); }
 
SecondVersion's Avatar
 


Name: Eric
Location: Kentucky
Trader Rating: (142)
Join Date: Mar 2005
Posts: 4,261
NP$: 541.00 (Donate)
SecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond repute
Member of the Month
MOTM September 2005 Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Cancer Alzheimer's Protect Our Planet
Originally Posted by trlg
actually i think one <br /> should be good enough?


Just one <br /> would cause each image to touch each other. Two <br />'s would ensure a line between each.

However, to each his own.
__________________

SecondVersion.com - The Personal Blog of SecondVersion
Domain Name Portfolio - Get your free copy. - Version 1.0.3 now available!!
SecondVersion is offline   Reply With Quote
Old 04-13-2008, 11:14 AM   · #7
trlg
NamePros Member
 
Trader Rating: (0)
Join Date: May 2007
Posts: 46
NP$: 0.00 (Donate)
trlg is an unknown quantity at this point
Originally Posted by SecondVersion
Just one <br /> would cause each image to touch each other. Two <br />'s would ensure a line between each.

However, to each his own.


yeah, i guess. It would be a matter of how you interpreted the poster's question...
trlg is offline   Reply With Quote
Closed Thread

NamePros is a revenue sharing forum.

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Site Sponsors
Hunting Moon http://www.mobisitetrader.com/ http://www.mobisitetrader.com/
Advertise your business at NamePros
All times are GMT -7. The time now is 12:08 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0