bstonehill
IS-IT--Management
I am trying to extract the default gateway ip address using explode. I am able to successfully extract it but it contains a blank space at the end of the variable which prevents me from using the variable to load the webpage in javascript. Can anyone tell me how to automatically remove the last character from a variable?
$ipconfig = shell_exec('ipconfig /all');
$explode = explode(':', $ipconfig);
$gateway = explode(" ", $explode[14]);
$router = $gateway[1];
TIA
$ipconfig = shell_exec('ipconfig /all');
$explode = explode(':', $ipconfig);
$gateway = explode(" ", $explode[14]);
$router = $gateway[1];
TIA