Jump to content

Save result of Var_dump to variable and use it


HenkDeVries
Go to solution Solved by WebStyles,

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));
   
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.