Re: Variables
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: Variables

From: Alvaro G Vicario <alvaro_QUITAR_REMOVE@telecomputeronline.com>
Date: Thu Jun 09 2005 - 16:26:37 CEST

*** CyberDog wrote/escribió (Thu, 09 Jun 2005 14:58:34 +0200):
> There are more ways to defina an variable:
>
> 1. $var = 'value'; Notice the '
> 2. $var = "value"; Notice the "
>
> and what is the third? Something like /"value/" I think...

As far as I know there're only two ways to define a variable: the =
operator and functions that receive arguments by reference and modify
arguments:

        $var='value';

and

        function asign_value(&$foo){
                $foo='value';
        }
        asign_value($var);
        
If you mean constants, you use the define() function:

        define('FOO', 'value');
        echo FOO;
        
And if you're talking about strings, you need to consider single quotes,
double quotes and dot (concatenation operator). Double quotes make PHP
perform variable parsing in strings.
        

-- 
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Received on Mon Oct 17 20:50:00 2005