[PHP] Write RegExp-Vars in a function

2003-09-01 Thread Niels Uhlendorf
Hi,

Although this seemed to be an easy prob I couldn't solve it in all the 
time.

I have a function and a string i want to be replaced. I use preg_replace 
and get a var out. Now I want this var in the function but I don't know 
how I can get it in:

preg_replace(#\[\+\+(.*)\+\+\]#Uis,my_function($1),$str); doesnt work 
at all and lots of other variations do not as well.

Please to be helping.

Greets
Niels
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] template engine

2003-06-19 Thread Niels Uhlendorf
Hi,

Since I don't want to continue with Smarty I started with an own 
(little) template engine. In this first try it should only replace
{for loops=INTEGER} ... {/for} through a trivial FOR-loop which runs 
INTEGER times.

This mission was sent to the function loop in this file:
http://www.offucia.org/pages/template-engine/source.php?file=engine.php
In this file I try to work with it
http://www.offucia.org/pages/template-engine/source.php?file=test.php
But the file loop() cannot be found and theres this mistake error:
Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or 
'$' in /www/htdocs/v035923/pages/template-engine/engine.php on line 26

Line 26 is this one:
$template = preg_replace(!{for loops=(.*)} (.*) 
{/for}!U,code($1,$2),$template);



Many thx 4 help
Niels Uhlendorf
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] [url] to html

2003-01-24 Thread Niels Uhlendorf
hi,

how to chang [url=%link%]%descr%[/url] in a href=%link%%descr%/a

thx 4 help.

Niels


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php