php session_start() function


  Translation results:

英[stɑ:t] US[stɑ:rt]

n.Start; set off; start; starting point

vt.& vi. Depart, set off

vt. Start; raise (question); start; make start

vi.Start; suddenly appear; suddenly jump up; suddenly gush out

Third person singular: starts Present participle: starting Past Formula: started Past participle: started

php session_start() functionsyntax

Function:Start a new session or reuse an existing session

Syntax: bool session_start ([ array $options = [] ] )

Parameters:

ParametersDescription
options This parameter is an associative array. If provided, the items in it will be used to overwrite the configuration items in the Session Configuration Instructions. The keys in this array need not contain the session. prefix.

Explanation: Returns TRUE if the session is successfully started, otherwise returns FALSE

php session_start() functionexample

<?php
session_start();
session_id(1);
session_name("admin");
echo "session_id:".session_id().",session_name:".session_name();
?>

Run instance»

Click the "Run instance" button to view the online instance

Output:

session_id:1,session_name:admin
<?php
session_start();
session_id(2);
session_name("php中文网");
echo "当前存储的sessionid为".session_id().",存储的session名为:".session_name();
?>

Run Instance»

Click the "Run Instance" button to view the online instance

Output:

当前存储的sessionid为2,存储的session名为:php中文网

Home

Videos

Q&A