Smarty Question About "Path" (not a biggy i guess)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Inter-Sex
    Confirmed User
    • Nov 2005
    • 2231

    #1

    Smarty Question About "Path" (not a biggy i guess)

    Hi,

    Got a small smarty script made, and the developper is with holidays right now.
    Maby anyone from here is willing to give me the solution.


    Code:
    $row2['url'] = $_site_www2.'/folder/'.$row2['2_folder'].'-name.ext';
    The settings (config.php) of www2 are :

    Code:
    $_site_www2 = 'http://www.domain2.com';
    The directory ['2_folder'] is named like "1XXX1_01" (w/o quotes)

    But i need to have the 1XXX1_ deleted from that part of the url, which it output.

    How I'd go around that ?

    Any help is apreciated,

    ~ Renaldo,
  • 1080p Content
    Registered User
    • Mar 2010
    • 85

    #2
    Code:
    $row2['url'] = $_site_www2.'/folder/'.str_replace('1XXX1_', '', $row2['2_folder']).'-name.ext';
    or if the string you want to remove is always same length but different numbers... i.e. "1XYZ1_"...

    Code:
    $row2['url'] = $_site_www2.'/folder/'.substr($row2['2_folder'], 6).'-name.ext';

    Comment

    • Inter-Sex
      Confirmed User
      • Nov 2005
      • 2231

      #3
      1080p Content,

      Thank you greatly for giving me the solution.
      This works like a charm.

      You've helped me great,

      ~ Renaldo,

      Comment

      Working...