Jump to content

Save result of Var_dump to variable and use it


HenkDeVries

Recommended Posts

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));
   

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.