HenkDeVries Posted February 26, 2014 Share Posted February 26, 2014 Hi, sorry I am new to php but I am a bit stuck. I am using below code to check a license through a webservice. The result of var_dump is bool(true).How can I save the True and use it to for example show an image or a text? Let's say if it's true show something when false do nothing function checkLicense($key, $url = null) { static $wsdl = 'X'; if ($url == null) { $url = $_SERVER['HTTP_HOST']; } $clientOptions = array( 'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP, //'trace'=> 1, // when the service b0rks, enable the tracing, for easier debugging ); $client = new SoapClient($wsdl, $clientOptions); $params = array( 'LicenseKey' => $key, 'URL' => $url, ); $checkLicenseResponse = $client->CheckLicense($params); return !empty($checkLicenseResponse->IsValid) && $checkLicenseResponse->IsValid === true; } $licensekey = Mage::getStoreConfig('SDOCP_options/module/enable_serial'); $url = ''; var_dump(checkLicense($licensekey, $url)); Link to comment https://forums.phpfreaks.com/topic/286557-save-result-of-var_dump-to-variable-and-use-it/ Share on other sites More sharing options...
WebStyles Posted February 26, 2014 Share Posted February 26, 2014 instead of var_dump, $result = checkLicense($licensekey, $url); will store the value in the variable $result. Link to comment https://forums.phpfreaks.com/topic/286557-save-result-of-var_dump-to-variable-and-use-it/#findComment-1470817 Share on other sites More sharing options...
HenkDeVries Posted February 27, 2014 Author Share Posted February 27, 2014 Thanks a lot that worked Link to comment https://forums.phpfreaks.com/topic/286557-save-result-of-var_dump-to-variable-and-use-it/#findComment-1470905 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.