Re: left

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Marco J.L wrote:
> Hello,
>
> how can I change the lenght of an value in basuc it's called LEFT or
RIGHT
> and MID . I read the filenames but I want to strip the extension from
the
> filename.
>
> ======== SCRIPT ==============
> <table style="font-family: tahoma,helvetica,arial; font-size: 12px;
> font-weight: bold; color: #000000">
> <?php
> $handle=opendir('news');
> while (false!==($file = readdir($handle))) {
>     if ($file != "." && $file != "..") {
>         echo "\n<TR><TD>$file\n";
>     }
> }
> closedir($handle);
> ?>
>
>    </body>
> </html>
> =======RESULT ========
>       200503290000.txt
>       200503300000.txt
>       200503310000.txt
>       200504010000.txt
>
> =======But I want this result : ======
>       200503290000
>       200503300000
>       200503310000
>       200504010000
>
> ===================

I'm not sure what your "Subject" line or the first part of your
question has to do with the second part, but you should take a look at
the substr() function <http://www.php.net/substr> and the pathinfo()
function <http://www.php.net/pathinfo>.

Combining those should give you what you're looking for.

Ken

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux