You are here: Re: parsing template using preg_replace_callback() « PHP Programming Language « IT news, forums, messages
Re: parsing template using preg_replace_callback()

Posted by mens libertina on 08/18/06 03:45

mens libertina wrote:
> Basically, I'm trying to use a template to send email reminders, but I
> can't use my backreferences the way I would like. (template.inc is not
> installed on my host.) If I'm approaching the problem wrong, please
> have mercy and tell me how to solve it! :)


Well, after spending 2 days on this, I was gently scolded to do the
quick and dirty approach instead of the clever approach. ("you spent 2
days on something that could take 15 seconds?!") I'm not going to
delete my work, just comment it out. Maybe next time I have to update
this, I will have a deeper understanding of PHP's mysteries. ;)

Since I know exactly which tags need replacing with which info:

$emesg = str_replace( "{NAME}", $info[name], $emesg );
$emesg = str_replace( "{USERNAME}", $info[user], $emesg );
$emesg = str_replace( "{EXPIRES}", $info[expires], $emesg );

print( "<p><pre>$emesg</pre></p>" );

Thank you, Jerry. If you have any more insight, feel free to email me
( my handle with /\s/_/ at yahoo ).

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация