<?php
$connection = ssh2_connect('shell.example.com', 22);
ssh2_auth_password($connection, 'username', 'password');
$shell = ssh2_shell($connection, 'xterm', null, 80, 24);
// Tell the remote end the terminal is now 132 columns by 43 rows
ssh2_shell_resize($shell, 132, 43);
?>