Steve Jacobsen
|
Posted: 09/14/2003, 8:52 AM |
|
I'm adding pictures to an application using the fileupload control. I've got all that working. I can upload pictures, display an url in a grid and when I click on it I go to a separate page to display the full picture. What I'm having problems with is the name of the file.
This is what's displayed in the grid: 200309111948380.saddameiffel.JPG
Here's the link: http://localhost/admin/Picture.php?Picture=200309111948380.saddameiffel.JPG
What I want is to have: saddameiffel.jpg displayed as the link. How can I clean off the yyyymmddhhmmss from the beginning of that string. Is there a control that does this or do I have to use regexp.
I'm working in PHP.
thanks.
Steve
|
|
|
DaveRexel
|
Posted: 09/14/2003, 9:58 AM |
|
::
If only the link display text is to be cleaned up
try PHP function
explode ( string separator, string string [, int limit])
Here's how to use it in CCS
$link_txt = [get_the_string_from_app]
$link_array = explode ( ".", $link_txt);
$arrlength = count($link_array);
$display_txt = $link_array[$arrlength-1].$link_array[$arrlength];
This will return the last two elements in your link display text
EG : MYPIC.JPG
Hope this helps.
Dave
|
|
|
|