Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

define(3) [php man page]

DEFINE(3)								 1								 DEFINE(3)

define - Defines a named constant

SYNOPSIS
bool define (string $name, mixed $value, [bool $case_insensitive = false]) DESCRIPTION
Defines a named constant at runtime. PARAMETERS
o $name - The name of the constant. o $value - The value of the constant; only scalar and null values are allowed. As of PHP 7 it also possible to use array value. Scalar val- ues are integer, float, string or boolean values. It is possible to define resource constants, however it is not recommended and may cause unpredictable behavior. o $case_insensitive - If set to TRUE, the constant will be defined case-insensitive. The default behavior is case-sensitive; i.e. CONSTANT and Con- stant represent different values. Note Case-insensitive constants are stored as lower-case. RETURN VALUES
Returns TRUE on success or FALSE on failure. CHANGELOG
+--------+---------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------+ | 7.0.0 | | | | | | | | | | array values are allowed. | | | | +--------+---------------------------+ EXAMPLES
Example #1 Defining Constants <?php define("CONSTANT", "Hello world."); echo CONSTANT; // outputs "Hello world." echo Constant; // outputs "Constant" and issues a notice. define("GREETING", "Hello you.", true); echo GREETING; // outputs "Hello you." echo Greeting; // outputs "Hello you." // Works as of PHP 7 define('ANIMALS', array( 'dog', 'cat', 'bird' )); echo ANIMALS[1]; // outputs "cat" ?> SEE ALSO
defined(3), constant(3), The section on Constants. PHP Documentation Group DEFINE(3)

Check Out this Related Man Page

APC_LOAD_CONSTANTS(3)							 1						     APC_LOAD_CONSTANTS(3)

apc_load_constants - Loads a set of constants from the cache

SYNOPSIS
bool apc_load_constants (string $key, [bool $case_sensitive = true]) DESCRIPTION
Loads a set of constants from the cache. PARAMETERS
o $key - The name of the constant set (that was stored with apc_define_constants(3)) to be retrieved. o $case_sensitive - The default behaviour for constants is to be declared case-sensitive; i.e. CONSTANT and Constant represent different values. If this parameter evaluates to FALSE the constants will be declared as case-insensitive symbols. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 apc_load_constants(3) example <?php $constants = array( 'ONE' => 1, 'TWO' => 2, 'THREE' => 3, ); apc_define_constants('numbers', $constants); apc_load_constants('numbers'); echo ONE, TWO, THREE; ?> The above example will output: 123 SEE ALSO
apc_define_constants(3), define(3), constant(3), Or the PHP constants reference. PHP Documentation Group APC_LOAD_CONSTANTS(3)
Man Page

14 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need Help on For Loop

Hi I need help i Loop format If i use the Following syntax $ for i in `echo "Hello world"` do echo $i done Output is: Hello world But i need Output in One line "Hello world" Can any one help? If i use while loop it works? (6 Replies)
Discussion started by: kash
6 Replies

2. AIX

end of case

hello How can I go out to a "case" boucle, but not finish the program : echo " your choice :" read grp1 do case ${grp1} in 1)grp1="toto1";; 2)grp1="toto2";; 3)grp1="toto3";; 4)grp1="toto4";; 5)grp1=t;; 6)grp1=t;; ... (3 Replies)
Discussion started by: pascalbout
3 Replies

3. UNIX for Dummies Questions & Answers

echo not echoing correctly

Here is the file named tuwork.......... 209 200 WZ 6529 SKTNCA01X4X C POI LODI LODI 738 SKTNCA0127T LOD Here is the scipt....... cat tuwork | while read rva do num=`echo $rva | cut -d" " -f1-2` reg=`echo $rva | cut -c10` ocn=`echo $rva | cut -c12-15` x=`echo $rva | cut -c29`... (3 Replies)
Discussion started by: shorty
3 Replies

4. Shell Programming and Scripting

Constant mirroring

I'm not sure how to best explain what I'd like to do, so let me give an example. I used to work in a department that deals with internet security. This department had an "internal" website (only people in the building can get on it) and an "external" website (anyone in the world can get on it --... (1 Reply)
Discussion started by: sstevens
1 Replies

5. UNIX for Dummies Questions & Answers

Comparing two strings those are outputs of echo

Hello, I have two strings those are outputs of two echo commands: $ logslist=`ls -1rt vp_lb_indv*.log | tail -1`; tail -7 $logslist | head -1 ERROR: Errors printed on pages 5,22. $ logslist=`ls -1rt vp_lb_indv*.log | tail -1`; errpages=`tail -7 $logslist | head -1`; echo... (3 Replies)
Discussion started by: memoconq
3 Replies

6. OS X (Apple)

Question about cat and echo

Hello, I am trying to send text to a USB to serial adaptor and then to an external speech synthesizer. I tried using the cat and echo commands with no luck. I have gotten some audio output from my synthesizer using Kermit a terminal emulator, so I am pretty sure my synthesizer and my USB to serial... (1 Reply)
Discussion started by: jamesapp
1 Replies

7. UNIX for Dummies Questions & Answers

What in the world does $$ mean?

If I type "echo $$" in to the command line it outputs some random number but it outputs the same one every time. What is this? (7 Replies)
Discussion started by: weexpectedthis
7 Replies

8. Shell Programming and Scripting

Trim not constant number of symbols ?

Hello, I need to trim zeros from left side: #echo $var1 00023456 But number of zeros is not constant. How do I do that ? thanks Vilius (4 Replies)
Discussion started by: vilius
4 Replies

9. Shell Programming and Scripting

Bash Questions

I am writing a Bash script that needs to get part of the current directory path. Let's say the current directory is /cat/dog/bird/mouse/ant. I know that the part that I want is between "bird/" and "/ant". In this case, I would want to set a variable to "mouse". If the current directory were... (4 Replies)
Discussion started by: RickS
4 Replies

10. Shell Programming and Scripting

Adding String at specific postition of a delimiter

I have a file containing data lines: 1|14|CONSTANT||11111111||00887722||30/04/2012|E|O|X||||20120528093654-30.04.2012|STA11ACT|ddts555S||||00001|rrttbbggcc| 1|15|CONSTANT||22222222||00887722||30/04/2012|E|O|X||||20120528093654-30.04.2012|rrtha772|llkis000||||00001|AAEtbbggcc| I want to add a... (3 Replies)
Discussion started by: pparthiv
3 Replies

11. UNIX for Dummies Questions & Answers

[Solved] How to swap PIPE seperator delimiter?

I have file like below 1|4|OR|OLAP|INT|INT||CONSTANT|2012/08/07|9999/12/31|0|0|0|0|PRL|-358.1684563||||||||||36522|55791|LNR| 2|4|OR|OLAP|CLR|CLR||CONSTANT|2012/09/07|9999/12/31|0|0|0|0|PRL|-358.1684563||||||||||36522|57891|REGS|... (2 Replies)
Discussion started by: gkskumar
2 Replies

12. Programming

String Constant C

I wonder string constant exists permanently or temporary. For example, printf("hello, world"); the function printf access to it is through a pointer. Does it mean storage is allocated for the string constant to exist permanently in memory? :confused: (4 Replies)
Discussion started by: kris26
4 Replies

13. Shell Programming and Scripting

"echo" outputs not appear into Log file

Hi, - From Script : echo "************************************" echo "NEW_ORACLE_SID : " ${NEW_ORACLE_SID} echo "************************************" echo "" >> /auto_clone/${NEW_ORACLE_SID}/logs/clone_PERP12R.log echo... (4 Replies)
Discussion started by: htaieb1
4 Replies

14. UNIX for Beginners Questions & Answers

Rows to columns

trying to sort an array, only the 4th column is uniq, have this: dog cat bird house1 dog cat bird house2 dog cat bird house3 rose daisy tulip house1 rose daisy tulip house3 would like this: dog cat bird house1 house2 house3 rose daisy tulip house1 missing house3 any help... (6 Replies)
Discussion started by: jimmyf
6 Replies