You are here: preg_replace question « PHP Programming Language « IT news, forums, messages
preg_replace question

Posted by willl69 on 11/03/05 06:42

Here is the code i have to read stings that are set out as such - {STRING}

$pattern = '/{(\w+)}/';
$replace = '$\1';
$template = preg_replace($pattern, $replace, $template);

This outputs $STRING

Anybody know how i can get the $STRING to $string within the preg_replace.
I have tried:
$replace = '$'.strtolower('\1');
but it doenst work.

Any help much appreciated.

Will

 

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

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