Child pages
  • Guide to the LiveAPI System - The fetch() Method
Skip to end of metadata
Go to start of metadata

 

Description

The fetch() method is a wrapper to return a hash reference from the  cpanelprint()  function, which retrieves a cPanel variable.

Note:

To return a data result for a cPanel variable's value, use the cpanelprint() method. 

Example  


LiveAPI PHP Class

// Get a hashref of the cPanel account's username.
$cpanel->fetch('$user');

LiveAPI Perl Module

# Get a hashref of the cPanel account's username.
$cpliveapi->fetch('$user');

Parameters

ParameterTypeDescriptionPossible valuesExample
variablestringA cPanel variable.

A valid cPanel variable.

Note:

For a full list of cPanel variables, read our Guide to cPanel Variables

$user

Returns

This method returns the cPanel variable's value as a hash reference.