Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

PHP Smarty Template question - how can I apply str_replace function to variable?

Posted on 2009-05-19
2
4,409 Views
Last Modified: 2013-12-13
I'm in the process of dealing with a PHP-based app that uses smarty templates, and I'm trying to figure out how to apply a str_replace() function to one of the variables that I'm encountering in one of the html templates:

{$product->display('product_image')}

This parameter resolves to an image path that I need to somehow change.  

More specifically, .. I need to update this image path using the str_replace() function.  I want to replace the string "/webauction/" with nothing (ie: "").  

How do I do that? is it even possible within a smarty template?

Tanks,
 - Yvan

0
Comment
Question by:egoselfaxis
2 Comments
 
LVL 7

Accepted Solution

by:
ycTIN earned 500 total points
ID: 24428646
0
 

Author Comment

by:egoselfaxis
ID: 24431410
Thanks - that's exactly what I was looking for!

- Yvan
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question