Jump to content


Capital letter variables in template

  • Please log in to reply
1 reply to this topic

#1 youme

  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 02 June 2006 - 05:24 PM

hi, i have seen several php scripts (can't recall) that use CAPITAL LETTERS for variables in a html template so that php script will parse to those variables.

I am trying to do the same for my script but don't how to approach that. thanks for your help

#2 poirot

  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 02 June 2006 - 05:30 PM

It's not just that - they won't magically be replaced if this is what you want. It requires a template system, which will search and replace the variables in the template files.

A simple way to do this is using str_replace(); but this may become more and more complex as you need to add more features.

If you're not very experienced, try to find and use a ready-made template system, like smarty...
[a href=\"http://smarty.php.net/\" target=\"_blank\"]http://smarty.php.net/[/a]
~ D Kuang

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users