Reputation: 4778
If i have:
print_r($request->getRequestVars());
that prints out:
Array ( [n] => Coors [s] => 3 )
how would i print out coors?
echo $request->getRequestVars()->n;
is not working, and i've tried several other things. I know this is super basic but it's frustrating me
Upvotes: 0
Views: 66
Reputation: 95161
Please note that $request->getRequestVars()
returns array not object. PHP 5.4
has Function Array Dereferencing if that is what you are running then you can have:
echo $request->getRequestVars()['n'];
else
$v = $request->getRequestVars();
echo $v['n'];
Upvotes: 2
Reputation: 328
I assume that the method $request->getRequestVars();
acutally returns an array.
So, you would have to do something along the lines of:
$foo = $request->getRequestVars();
echo $foo['n'];
Upvotes: 2