Ik ben een VPS control panel zoals(Virtuozzo en Hypervm etc.) aan het maken. Het lukt al aardig maar ik ben bezig met explode enz. Ik heb heel veel overbodige spaties:
Array ( [0] => [1] => [2] => [3] => [4] => [5] => VPSID [6] => [7] => [8] => [9] => [10] => [11] => NPROC [12] => STATUS [13] => [14] => IP_ADDR [15] => [16] => [17] => [18] => [19] => [20] => [21] => [22] => [23] => HOSTNAME [24] => [25] => [26] => [27] => [28] => [29] => [30] => [31] => [32] => [33] => [34] => [35] => [36] => [37] => [38] => [39] => [40] => [41] => [42] => [43] => [44] => [45] => [46] => [47] => [48] => [49] => [50] => [51] => [52] => [53] => [54] => 101 [55] => [56] => [57] => [58] => [59] => [60] => [61] => [62] => [63] => 10 [64] => running [65] => 193.33.60.60 [66] => [67] => [68] => [69] => tmp [70] => [71] => [72] => [73] => [74] => [75] => [76] => [77] => [78] => [79] => [80] => [81] => [82] => [83] => [84] => [85] => [86] => [87] => [88] => [89] => [90] => [91] => [92] => [93] => [94] => [95] => [96] => [97] => [98] => [99] => [100] => [101] => [102] => [103] => [104] => [105] => 102 [106] => [107] => [108] => [109] => [110] => [111] => [112] => [113] => [114] => [115] => 3 [116] => running [117] => 193.33.60.61 [118] => [119] => [120] => [121] => vps05.dream-hosting.eu [122] => [123] => [124] => [125] => [126] => [127] => [128] => [129] => [130] => [131] =>
Hoe kan ik dat weghalen? Mijn script:
<?
$connection = ssh2_connect('localhost', 22);
ssh2_auth_password($connection, 'root', '');
$stream = ssh2_exec($connection, 'vzlist -a');
stream_set_blocking($stream, true);
$cmd=fread($stream,8192);
?>
<h2>VPS List:</h2>
<br>
<?
$list = explode(" ", $cmd);
print_r($list);
?>
B.V.D.,
A. Janssen