Re: Got another ripper for you all ;-)

From: Date: Thu, 15 Aug 2002 07:30:22 +0000
Subject: Re: Got another ripper for you all ;-)
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-112710@lists.php.net to get a copy of this message
Well, I found out a way to do it... A litte bit more coding than should have been required, but still... $ulist=command("user list name=$username domain=$domain"); $ulist[1] = str_replace('Dir : ', '', $ulist[1]); $dir = $ulist[1]; $strlen = strlen($dir); $strlen = $strlen - "1"; $dir = substr($dir, 0, $strlen); $dir = $dir."/data"; if ($handle = opendir("$dir")) { $i = "0"; while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $i++; } } echo "$i"; closedir($handle); } } ----- Original Message ----- From: "Liam MacKenzie" <phplist@operationenigma.com> To: <php-general@lists.php.net> Sent: Thursday, August 15, 2002 3:38 PM Subject: Re: [PHP] Got another ripper for you all ;-) Nup, still doesn't work. I can't get rid of that newline! Here... Eat your heart out: function get_num_emails($username, $domain) { $ulist=command("user list name=$username domain=$domain"); $ulist[1] = str_replace('Dir : ', '', $ulist[1]); trim($ulist[1]); echo "|".$ulist[1]."|"; if ($handle = opendir("$ulist[1]/data")) { $i = "0"; while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $i++; } } echo "$i"; closedir($handle); } } It's meant to check how many emails that particular user has got, but it can't get the dir listing because of that damned new line! Any more ideas? Cheers, Liam ----- Original Message ----- From: "Liam MacKenzie" <phplist@operationenigma.com> To: "Tom Rogers" <trogers@kwikin.com> Cc: <php-general@lists.php.net> Sent: Thursday, August 15, 2002 3:32 PM Subject: Re: [PHP] Got another ripper for you all ;-) Oh.... Whoops.... Thanks Tom ----- Original Message ----- From: "Tom Rogers" <trogers@kwikin.com> To: "Liam MacKenzie" <phplist@operationenigma.com> Cc: <php-general@lists.php.net> Sent: Thursday, August 15, 2002 3:34 PM Subject: Re: [PHP] Got another ripper for you all ;-) Hi, Thursday, August 15, 2002, 3:20:47 PM, you wrote: >snip LM> Is there a way to get rid of any new lines in a string? LM> Because this is making my directory listing go whacko. LM> Cheers, LM> Liam trim($dir) -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#112710) next »