Jump to content

[SOLVED] ternary operator help :(


sasori

Recommended Posts

please help me guys, i don't know how to use the ternary operator in my code :( ???

 

<?php

/**
* @author rmbapc
* @copyright 2008
*/

require_once('emailer.class.php');
require_once('extendedmailer.class.php');
require_once('htmlemailer.class.php');
$emailer = new emailer('[email protected]');
$extendedemailer = new ExtendedEmailer();
$htmlemailer = new HtmlEmailer('[email protected]');
if($extendedemailer instanceof emailer)? echo "extended is dereived from emailer":"not derived from";//not working help please 
/*echo "Extended Emailer is derived from Emailer.<br/>";
if($htmlemailer instanceof emailer)
echo "HTML Emailer is also derived from Emailer.<br/>";
if($emailer instanceof htmlEmailer)
echo "Emailer is derived from HTMLEmailer<br/>";
if($htmlemailer instanceof ExtendedEmailer)
echo "HTML Emailer is Derived from Emailer<br/>";
*/
?>

Link to comment
https://forums.phpfreaks.com/topic/118862-solved-ternary-operator-help/
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.