Thursday, March 2, 2017

Replace all values inside multiple variable names

I am pulling lots of forms using Guzzle. The forms comes with eval function. Since I am using Laravel, native $_SESSION variables will throw errors once form rendered.I want to replace those variables with values with $_SESSION

$devicetype = $_SESSION['device']['type'];\r\n
$os = $_SESSION['browser']['os']. " version " . $_SESSION['browser'] ['os_version'];\r\n

I want to replace variable values with values from my custom Facade functions

$device = MYFuction::device() //returns tablet
$os = MyFacade::device()//returns 'windows'

etc..

Any Ideas?



via Ian Adem

Advertisement