Jump to content

If Value Exists


arunpatal

Recommended Posts

<?php
if(isset($codes3)) {
// execture that it does have a value
} else {
// It does not have a value
}
?>

 

I am new so can you please write this code include with my code...

 

I tried like this

 

<?php if(isset($codes3)) {
'<div id="detaildisplay_box"> echo $code3; </div>' ;
}
else {
'<div id="detaildisplay_box"> echo "No Value!" </div>';
}
?>

 

But its not working

Link to comment
https://forums.phpfreaks.com/topic/270725-if-value-exists/#findComment-1392610
Share on other sites

Sigh...It's not hard at all. In fact I shouldn't really even do it if you don't even know the echo function. I suggest going http://www.w3schools...php/default.asp for a good start. But I suppose I'll help anyways:

<?php
if(isset($codes3)) {
echo "
<br />
<div id='codedisplay_box' style='overflow: auto;'><code><xmp> $codes3</xmp></code></div>
<br />";
}
?>

Link to comment
https://forums.phpfreaks.com/topic/270725-if-value-exists/#findComment-1392611
Share on other sites

Sigh...It's not hard at all. In fact I shouldn't really even do it if you don't even know the echo function. I suggest going http://www.w3schools...php/default.asp for a good start. But I suppose I'll help anyways:

<?php
if(isset($codes3)) {
echo "
<br />
<div id='codedisplay_box' style='overflow: auto;'><code><xmp> $codes3</xmp></code></div>
<br />";
}
?>

 

Thanks for help (it just work nice)

 

Can you check if this also should be fine

 

<?php if(isset($codes3)) {
'<div id="detaildisplay_box"> echo $code3; </div>' ;
}
else {
'<div id="detaildisplay_box"> echo "No Value!" </div>';
}
?>

Link to comment
https://forums.phpfreaks.com/topic/270725-if-value-exists/#findComment-1392612
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.