php - assign the individual string array values to a global array, it doesnt return anything
Get the solution ↓↓↓Solution:
Use
$_GLOBALS['variablename'] = value
To set it value and
$_GLOBALS['variablename']
To get it value.
Answer
Solution:
First you declare the variables to be global, then you asign them, not at the same time, this will give a parse error.
Not:
global $reqFName = $accessEmailParams["reqFName"];
But:
global $reqFName ;
$reqFName = $accessEmailParams["reqFName"];
Hope this helps.
Answer
Solution:
That would appear to be a syntax error, at least in PHP 5.4.12:
Parse error: parse error, expecting
','' or
';''
You need to declare the global on one line, and assign to it on another line:
function processRequestAfterApproval($accessEmailParams) {
global $reqFName;
$reqFName = $accessEmailParams["reqFName"];
}
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: integrity constraint violation: 1452 cannot add or update a child row: a foreign key constraint fails
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.