We have a new documentation site for cPanel & WHM! You can find our new documentation site at docs.cpanel.net.

We will continue to maintain our API documentation on this server.

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


The cpanelprint() method returns  a cPanel variable's value.



To return a hash reference of a cPanel variable's value, use the fetch() method. 


LiveAPI PHP Module

// Retrieve the cPanel account's username.

LiveAPI Perl Module

# Retrieve the cPanel account's username.


ParameterTypeDescriptionPossible valuesExample
variablestringA cPanel variable.

A valid cPanel variable. Surround this variable with single quotes ('')


  • The single quotes in this example are required. The method does not interpolate them. Instead, it passes those quotes to cPanel's print function, which requires them in order to return the correct value.
  • For a full list of cPanel variables, read our Guide to cPanel Variables


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