note 52067 added to function.dirname
| From: | evandrofelipee at yahoo dot com dot br | Date: | Wed, 20 Apr 2005 14:02:12 +0000 |
| Subject: | note 52067 added to function.dirname | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-88264@lists.php.net to get a copy of this message | ||
Oi! Meu nome é Evandro Felipe e moro no Brasil Valença Rio de Janeiro. Depois de muito procurar e
não encontrar, fiz uma funcao que retorna somente a URL do caminho digitado mesmo que ele tenha um
subdiretorio. Espero ter ajudado.
Hello! My name is Evandro Felipe and lives in Brazil Valença Rio De Janeiro. After very looking
for and not finding, I made one function that it only returns the URL from the typed way exactly
that it has a subdiretorio. I wait to have helped.
<?
$curlsite="http://www.mensagensdocoracao.com.br/banner-publicidade";
$full_url = sprintf($curlsite);
$domain = "";
$count=0;
for($i = 0;$i<=strlen($full_url);$i++)
{
$dummy = substr($full_url,$i,1);
if ($dummy == "/")
{$count=$count+1;}
if (($dummy == "/") and ($count>=3))
{
break;
}
$domain = $domain.$dummy;
}
echo $domain;
?>
----
Manual Page -- http://www.php.net/manual/en/function.dirname.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52067
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52067&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52067&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52067&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52067&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52067&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52067&report=yes
Search -- http://master.php.net/manage/user-notes.php