note 50373 added to function.substr

From: Date: Sat, 26 Feb 2005 00:06:28 +0000
Subject: note 50373 added to function.substr
Groups: php.notes 
Request: Send a blank email to php-notes+get-85569@lists.php.net to get a copy of this message
what about this one ? <?php $addr = Substr($_SERVER["HTTP_HOST"],0, strpos($_SERVER["HTTP_HOST"],".")); if(is_dir($addr)) { echo '<a href="./'.$addr.'/">'.$addr.'</a>'; } else { echo "<pre>Le dossier \"$addr\" n'existe pas .</pre>"; } ?> We can use it to "create" domains : for example : name.domain.com will return name, so then, let's just taste variable and do. ---- Manual Page -- http://www.php.net/manual/en/function.substr.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+50373 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50373&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50373&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50373&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50373&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50373&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+50373&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#85569) next »