4 ms·
$mbox = imap_open( $host, $login, $password ); foreach( imap_search( $mbox, 'UNSEEN', SE_UID ) as $uid ) { $header = imap_fetch_overview( $mbox, $uid, FT
by IgorPartola 17y ago
$mbox = imap_open( $host, $login, $password );
foreach( imap_search( $mbox, 'UNSEEN', SE_UID ) as $uid ) {
$header = imap_fetch_overview( $mbox, $uid, FT_UID );
echo $header[0]->subject . "\n";
}
imap_close( $mbox );
- edd 17y ago$status_url = 'http://twitter.com/statuses/user_timeline.json?screen_name='.$user; $timeline = json_decode(file_get_contents($status_url)); for($i = 0; $i < count($timeline); $i++){ echo $timeline[$i]->text ."\n"; } One line in it then.
- PanMan 17y agoThe count in the loop slows it down quite a bit:http://tips4php.com/2010/01/best-way-to-traverse-trough-an-array/ http://tips4php.com/2010/01/best-way-to-traverse-trough-an-a... Foreach is easier to write, and faster to run :)
- deleted 17y ago[deleted]