Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

get cpanel username php

<?php
function getCpanelUsername($label=''){
	$parts = preg_replace('//+/', '/',$_SERVER["DOCUMENT_ROOT"]);
	$path_parts = array_pad(explode('/', $parts),100,null);
	if(is_int($label)){
	return $path_parts[$label];
	}else{
	 return $path_parts[2];
	}
}

echo getCpanelUsername();
?>
 
PREVIOUS NEXT
Tagged: #cpanel #username #php
ADD COMMENT
Topic
Name
7+8 =