Jump to content

rtrim problem


mendoz

Recommended Posts

Hello again  :o :o :o :o

Almost done with this thing:
http://control-pc.co.il/products/testar.php

Please go inside and check the hp one.

see? instead of giving [i]h[/i]p it gives [i]h[/i].

this is the code

[code]<?php echo rtrim($files[$i],".jpg"); ?>[/code]

What is wrong with me?!
Link to comment
Share on other sites

try somin like this maybe... it'll cut off everything after the last . instead of off of a number or what all else :-)
[code]<?
function get_filename($filepath){
return substr($filepath, 0, strpos($filepath, strrchr($filepath, ".")));
}
?>[/code]
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.