I tried searching on Google but do not really know how to search for it properly.
What I want to do is remove the first part of a MySql record displayed on a PHP page i.e
'file:15550000.jpg' and I want to remove the 'file:' from the result and just display the '15550000.jpg', I didnt know how to search for this in Google or this forum.
Sorry if this is a bit gobbledygook.
MySql record
Moderator: General Moderators
- Gente
- Forum Contributor
- Posts: 252
- Joined: Wed Jun 13, 2007 9:43 am
- Location: Ukraine, Kharkov
- Contact:
Use instead of
Code: Select all
echo substr($row['your_var'], 5);Code: Select all
echo $row['your_var'];I'd fix it in the SQL...
Code: Select all
SELECT `myTable`.`file_id`,
`myTable`.`file_size`,
`myTable`.`file_type`,
SUBSTRING(`myTable`.`file_name`,5) AS file_name_fixed
FROM `myTable`;