Hi everyone,
    I'm a good perl programmer, but I'm not able to translate this small
Perl program to PHP:

$testo = 'Hi <%NOME%>, how are you? Tomorrow I\'ll go to <%DESTINAZIONE%>
with <%AMICO%>!';

%mioArray=( 'NOME' => 'Pippo',
   'AMICO' => 'Pluto',
   'DESTINAZIONE' => 'Roma');

print $testo."\n\n";

$testo =~ s/<%([a-zA-Z]*)%>/$mioArray{$1}/g;    # <== this is my problem!!!

print $testo."\n";


This is the output of the script:

Hi <%NOME%>, how are you? Tomorrow I'll go to <%DESTINAZIONE%> with
<%AMICO%>!

Hi Pippo, how are you? Tomorrow I'll go to Roma with Pluto!



HELP ME PLEASE!!! :)





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to