473,397 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

left

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

===================
Thanx,

Marco J.L.

Jul 17 '05 #1
2 1496
On Wed, 06 Apr 2005 21:58:40 +0200, 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

===================
Thanx,

Marco J.L.


substr ( $name, 0, strlen ( $name ) - strlen ( '.txt' ) ); or
substr ( $name, 0, strrpos ( $name, '.' ) );

I'm probably the odd character out, but you get the idea...
Steve

Jul 17 '05 #2

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

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Wayne Wengert | last post by:
I use statements like LEFT(textstring,6) in my app. I have "Imports Microsoft.VisualBasic" at the top of the code but to use LEFT I have to code : Microsoft.VisualBasic.Left(sting, integer) If...
4
by: Harlan Messinger | last post by:
What is *supposed* to be the way to specify the horizontal offset of (a) the list item's marker and (b) the list item's content? In particular, see ...
4
by: jbm05 | last post by:
Hi, I'm curious about the computational complexity of a query I have. The query contains multiple nested self left joins, starting with a simple select, then doing a self left join with the...
1
by: fleemo17 | last post by:
For increased accessibility, I've replaced "display:none" with the Off-Left method of hiding my CSS drop-down menus because the Jaws screen reader doesn't see any of the menus hidden with...
17
by: Nathan Given | last post by:
Hello All, I am trying to debug a broken query. The query uses Left$(,4) instead of Left(,4). What is the difference between the Left() and Left$() functions in Microsoft Access? Thanks!...
0
by: jonipony | last post by:
HELP: Float Left box is drifting to the right in ie! -------------------------- I need som HELP with my CSS coding! On the following web page my design falls apart at screen size 800 x 600...
8
by: marco | last post by:
Hi ! I have this part of code and i can not find out why the scroller is starting from left to right instead RIGHT to LEFT. This is the main part and the scroller is working fine but from the...
6
by: Samuel Rhodes | last post by:
Hi I am trying to write a code snippet that would display a '?' sign on the top left of a control. I do not want to hard code the positioning of the DIV which will contain that '?'. Is it...
6
by: =?Utf-8?B?R3JlZw==?= | last post by:
I have two questions with regards to the LEFT function. I ran into a problem with the LEFT function today. I knew it was a valid Function, but when I tried to use it, it was getting interpreted...
4
by: moondaddy | last post by:
I have a wpf project where I use a canvas to drag shapes around. when I drag a shape beyond the right or bottom side I get scrollbars which is good. I also get scrollbars when I zoom in and a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.