substr() question
Posted: Thu Jul 11, 2002 5:56 pm
How can remove the last 4 characters from the value of a variable???
example:
i have a variable with the value of "index.inc"
I want to remove the .inc from the end, so that the value is "index"
Im told substr() can do this, but when i use it like this:
($file is just $viewFile without the .inc) it doesn't work.
Can anyone help?
example:
i have a variable with the value of "index.inc"
I want to remove the .inc from the end, so that the value is "index"
Im told substr() can do this, but when i use it like this:
Code: Select all
$file = substr("$viewFile", 0, -4);Can anyone help?