Results from the most recent live auction are here .
15 members in the live chat room. Join Chat !
04-10-2008, 08:33 AM
· #1 NamePros Member
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
04-10-2008, 08:41 AM
· #2 while ($awake){ code(); }
Name: Eric
Location: Kentucky
Join Date: Mar 2005
Posts: 4,261
NP$: 541.00 (
Donate )
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\" /> " ;
}
}
?>
04-10-2008, 08:50 AM
· #3 NamePros Member
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\" /> " ;
}
}
?>
04-10-2008, 07:26 PM
· #4 NamePros Regular
Name: Justin
Location: Sydney
Join Date: Jun 2006
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.
04-13-2008, 11:03 AM
· #5 NamePros Member
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\" /> " ;
}
}
?>
04-13-2008, 11:10 AM
· #6 while ($awake){ code(); }
Name: Eric
Location: Kentucky
Join Date: Mar 2005
Posts: 4,261
NP$: 541.00 (
Donate )
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.
04-13-2008, 11:14 AM
· #7 NamePros Member
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...
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off