You are here: Pulling variables from str_replace « PHP Programming Language « IT news, forums, messages
Pulling variables from str_replace

Posted by Brad Everman on 09/21/06 14:22

Something simple, perhaps someone can shed some light.

I have an array of paragraphs of text and am replacing some of the text
using str_replace().

Ex.

function addGraphic($numGraphic){

return("this is graphic $numGraphic");

}

$instruction = str_replace("#GRAPHIC[$i]",addGraphic($i),$instruction);


Basically, I look for the tag #GRAPHIC[n] in the text where n is an
integer value and want to replace it with the text and the actual number
inside the brackets. I am unsure how to parse this value out and then pass
it to the function that will create the appropriate output.

Thanks for any help.

 

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

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