answersLogoWhite

0

Maybe your speaking a variable that contains a ternary operators such as:

$variable = (1 == 1) ? 'value-if-true' : 'value-if-false';

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

How to display a variable in PHP using echo or print statements?

displaying a variable in php using echo statement? <?php $name="ram"; //declaring and defining the variable echo "$name"; //printing the variable using echo command ?>


How do you do the pass the variable value to the query in same php page?

To pass PHP Variable value in Jquery simpley echo that variable : Eg <script> var jQueryVariable=<?php echo $anyVariable?> </script>


How can you declare the variable in PHP?

Variables in PHP do not need to be declared like some languages (e.g. JavaScript). This is all that needs to be done to assign a variable: $variable = "Value";


How do you represent a variable in PHP?

Variables in php begin with $ and are declared by the user. $str1 = "wiki"; would store "wiki" into the variable $str1


How do you equate a php variable to a javascript variable?

Ideal thing would be to retrieve the value from PHP using AJAX and then assigning it to a java script variable. Thereafter compare it to the java script variable that is already present.


Write down a PHP code to add a session variable?

The preferred way is to simply alter the session superglobal. <?php $_SESSION['variable'] = "value"; ?>


What are rules used in naming php variable?

Well, firstly, all PHP variable names begin with the dollar sign. After that...PHP variable names must begin with either a letter or an underscore ( _ )PHP variable names can only contain letters, numbers, and underscores.A variable cannot contain spaces. Therefore variable names using more than one word should be separated using an underscore or camel cased. e.g. $multiple_word_variable_name OR $multipleWordVariableName.


How do you clear a variable in PHP?

You can unset a variable in PHP by setting it to NULL. You can set a variable to NULL by declaring it normally, or using the function "unset()". Both methods are acceptable, and accomplish the same thing. Examples of both: ---- $variable = NULL; ---- unset($variable); ----


What symbol denotes a variable in php?

The money sine ($) denotes a variable in PHP; for example: $var = 'foobar'; It can also be used to reference an array, object, any of the othe typical things that can be assigned to a variable.


Are you required to initiate a variable when you first declare it in php?

no


What is php plus plus?

PHP++ is an object-oriented version of the PHP programming language. ++ is used in programming to increment a variable by one so it means an improved version of PHP.


What is the Use of a dollar sign in php?

the dollar sign appears before a variable/array. Essentially it just tells php that its a variable. $food = "cheese pizza"; or $myfavoritenumber = 2 ;


How do you rectify HTML to PHP variable error?

To use HTML as variable in PHP . echo the html tag written in double quotes. Example : <?php echo "<table>"; echo "<tr><td></td><td></td></tr>" echo "</table>"; ?>


How do you create static variables in PHP?

Use the "static" keyword to declare a static variable within a function like shown below. <?php function fun() { static $variable; static $another_variable = ''; } ?>


Why does typing SHIFTf4name will not highlight or register as a variable in notepad plus plus coding in php?

In php a variable is declared using $ sign for eg. $name or $sport= 'Volleyball';. If you are not using this sign it won't work.


How can a PHP static be initialized?

PHP static can only be initialized using a literal or constant. You can not use an expression. You can initialize it to an integer but you may not to another variable.


What is the Use of a double dollar sign in php?

A double dollar sign in php makes a variable with a name equal to the value of the original variable. It works like this:$var = "keith";$$var = "palmer";print ($keith);// The output is: palmer


In PHP you can use both single quotes ( ' ' ) and double quotes ( ) for strings?

You can use single quotes $variable = 'string'; You can use double quotes $variable = "string"; You can use the Heredoc method $variable = <<<EOT Very Long String EOT; And you can use the Nowdoc method (after PHP 5.3.0) $variable = <<<'EOT' Very Long String EOT;


What is a name for a variable used for storing true false statements?

Usually, the name of the variable can be most anything. This type of variable is called a LOGICAL variable.


What does the increment operator do in PHP?

The incremental operator increases the variable by 1. See the example below: <?php $number = 10; $number++; echo $number; // outputs 11 ?>