christian5531 christian5531
  • 07-08-2019
  • Computers and Technology
contestada

Which of the following that can be use to access session variables in PHP?

Select one:

a. $_SESSION

b. start_session()

c. session_start()

d. $_SESSIONS

Respuesta :

Branta Branta
  • 12-08-2019

Answer:

a. $_SESSION

Explanation:

A session variable in PHP can be accessed using the global variable $_SESSION.

This can be used for both setting and retrieving session values as described subsequently.

$_SESSION["var1"] = "value1";

This set a session variable called 'var1' to a value 'value1'. Later if we want to retrieve this value we can do it as follows:

echo "Value of session variable 'var1' is " . $_SESSION["var1"] ;

This will print the result: Value of session variable 'var1' is value1

Answer Link

Otras preguntas

What does it mean to have a “controlled” experiment?
What are 3terms uses to describe organisms such as humans?
According to the CAPM, what is the expected market return given an expected return on a security of 15.8%, a stock beta of 1.2, and a risk-free interest rate of
What do u hope u don’t have to learn in science this year?
An atom has 11 protons, 11 electrons, and 10 neutrons. What is its
A length of fishing line measures 5470 cm. How many kilometers is that length? Question options: 5.47 km 0.547 km 54.7 km 0.0547 km
Write the range of f(x) in all three notations if the domain is -2 < x < 6 . f(x)=x+3f(x)=x+3
Some movies are profitable and others are not . Understandably , the movie industry would like to know what makes a movie successful . Data from 728 first-run m
Hi everyone my name sis
Could cellular respiration happen without photosynthesis? Explain your reasoning