How can we register the variables into a Session?

Answer Posted / tarun

session_start();
$ses_variable="name";
session_register('ses_varaible');


// to access the session
echo $_SESSION['ses_variable'];

Is This Answer Correct ?    6 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between myisam and innodb?

509


What is mysqli_query?

511


What are the 5 types of variables?

565


What is mysql_real_escape_string used for?

561


How many types of php frameworks are there?

490






How to check if a string contains a character or word in php?

538


Tell me what is the importance of "action" attribute in a html form?

540


What is encapsulation in php?

563


What is string in php?

566


Tell me which function gives us the number of affected entries by a query?

523


Explain scalar type declarations in php7?

553


What is the difference between Split and Explode in PHP?

576


Is php a middleware?

514


How do I escape data before storing it in the database?

574


Is laravel better than codeigniter?

553