Jump to content

How To Set Php Request If Option Is Empty Dont Show That


MahdiRiyahi

Recommended Posts

this is my code: i want

$theme['type']

just whene show this arry have somting. but in this code this tag if dont have somting also load this tag

<?php
foreach ($theme_array as $i => $theme) :
echo '<li ><a href="#" rel="' . $theme['url'] . ',' . $theme['themeforest'] . '">' .
ucfirst($theme['id']) .
' <span class="product-type">'.$theme['type'].'</span>';
if(isset($theme['preview'])){
echo '<span class="product-preview"><img src="';
if(strpos($theme['preview'], 'http://') === false){
echo 'product_previews/'.$theme['preview'];
}
else echo $theme['preview'];
echo '" /></span>';
}
echo '</a></li>';
endforeach;
?>

 

this is my arry code:

$theme_array = array (
array ("id" => "سیمرغ (JM Thunderbird)",
   "link" => "Thunderbird",
   "preview" => "http://localho/5/screen/jm-ascent-blue.jpg",
   "url" => "http://demo.joomi.ir/tlate/jmphoenix/",
   "themeforest" => "http://uy"
  ),

array ("id" => "فونیکس (JM Phoenix)",
   "type" => "جوملا ۲.۵",
   "free" => "رایگان",
   "link" => "phoenix",
   "preview" => "http://localhost/5/screen/jm-ascent-blue.jpg",
   "url" => "http://demo.joomi.ir/template/jmphoenix/",
   "themeforest" => "http://buy"
  )
);

& this is my problem in picture :

17901696217618455210.jpg

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.