Jump to content

[SOLVED] GRRRRRRRRRRRR


ToonMariner

Recommended Posts

Done this before and can't bloody replicate it...

 

I have a string that contains place holders like so...

 

Hello #name# and welcome to playgroup. You are #age# and have #limbs#.

 

I have an array like so..

<?php
$data['name'] = 'George';
$data['age'] = 3;
$data['limbs'] = 4;
?>

 

so I want to replace #XX# with the corresponding index in the array...

 

something like...

 

preg_replace('/#(.)*?#/',$data['$1'],$str);

 

but I just can't get it...

 

Please help before my monitor takes a hit.

Link to comment
https://forums.phpfreaks.com/topic/61682-solved-grrrrrrrrrrrr/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.