Announcement

Collapse
No announcement yet.

php basename() type function

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    php basename() type function

    Hey all,

    I am in need of something that works with actinic that mirrors the effect the basename() function has in php.

    Basically, i am using a thumb image in a fragment that i would like the code to reference a larger image that i know exists on the server (as it has been uploaded elsewhere).

    But the problem is that when i put the 'FragmentImageFileName' variable into code, it brings in a full url of the local file (/product_gfx/bb09/...jpg) etc

    This is fine as usually i can create a php function to find what i need and display it - in this instance the basename() function is perfect. But it just crashes Actinic.

    I have tried changing the appearance of the variable to all the options (HTML, Strip HTML, Quoted Perl...) but they all bomb out.

    I have tried to bring the variable in, edit it slightly in PHP and try it in an attempt to stop Actinic from doing something to make it crash.

    Ive also tried a substr(strrchr()) workaround

    All without any success and crashing actinic.

    Anyone have any ideas?

    Thanks

    Dan
    Nineplus.com - Surfboards, Longboards, Wetsuits and Accessories.

    #2
    - explode to an array (delimited by slash)
    - reverse the array
    - $array[0];

    PHP Code:
    $sFilename ="[actinic variable]";
    $aTemp explode("\\"$sFilename);
    $aTemparray_reverse($aTemp);
    $sFilenameBase $aTemp[0]; 
    (i had some code at hand so i whipped it in here for you)

    Comment

    Working...
    X