Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strings and patterns

Status
Not open for further replies.

gunnerh

Technical User
Nov 25, 2008
2
GB
I need some php code.

I only know the basics of PHP and need what hopefully might
just be a few lines of code.

I would be grateful if someone could supply.

(My head is spinning with ereg pattern matching)


The requirement:

--------------------------------------------------------
I have a string which can contain any number of 'tokens'.
A token is text enclosed by {}

So for example

==> Hello {abc}, goodbye {def}

I want to remove the {} and replace each token
with a string derived from the token.

So I end up with

==> Hello xxx, goodbye yyy

where xxx = function (abc)
yyy = function (def)
--------------------------------------------------------

Thanks
 
I am stunned.

Basically you've done it all with one command

Thank you SOOOOOO MUCH !

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top