Operator Syntax Question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Clandestine
Forum Newbie
Posts: 1
Joined: Tue Feb 14, 2006 2:47 pm

Operator Syntax Question

Post by Clandestine »

feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Code: Select all

<?
defined('OK') or die();

/* Carga la configuracion para acceso */
/* Load default login configuration */

return array(
// Nombre del campo usuario / User field name
'login:usuario' => array('sdata','user'),

// Nombre del campo de contraseña / Password field name
'login:contrasinal' => array('sdata','pass'),

// Si la contraseña se recibe ya encriptada o si debemos encriptarla antes
// de realizar la comprobación de login
// If the password it's encripted or if pfn must crypted after check user
// true = it's encripted | false = pfn must crypt
'login:encriptada' => true,

// Metodo para obtener los datos / Method to obtain data
// post | get | session | server
'login:metodo' => 'session'
);
?>

This code is in a file (login.inc.php) included in another file (index.php). "index.php" contains the following code:

<?
$_SESSION['sdata'][] = array(
"user" => "test",
"pass" => md5("test")
);
?>
Can someone tell me what purpose the colon serves between "login" and "usuario"? Or could you just explain what is happening here? What is "login:usuario"? Any way you can answer the question would be helpful.

It is valid as far as syntax goes, because it is used often in the code of PHPfileNavigator (http://pfn.sourceforge.net), but I haven't seen it before now.

Thanks for any help!


feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

It's being used a form of seperation and heirarchy set up it appears. Otherwise, someone may be required to use multidimensional arrays to store the information they are doing.
Post Reply