We help IT Professionals succeed at work.
Get Started

Function to Altering Text String

Last Modified: 2012-05-12
Hi experts !

I need a function to alter the content of an item description text. I want to insert a piece of text after the first "." found on the string. I want to do it 3 times, with the first 3 "." found.

Please see the code attached and see the image attached which is an example on how result should be.

Rewrite_Description($add1,$add2,$add3, $description)

Please help me with a good function to make possible this.


$add1 = "The Author of this Book is Matt Green.";
$add2 = "This book was written on 1999.";
$add3 = "The Genero of this book is Fiction";

$description = "The drama was cultivated by the Incas, and dramatic performances were enacted before them. Garcilasso de la Vega, Molina, and Salcamayhua are the authorities who received and have recorded the information given by the Amautas respecting the Inca drama. Some of these dramas, and portions of others, were preserved in the memories of members of Inca and Amauta families. The Spanish priests, especially the Jesuits of Juli, soon discovered the dramatic aptitude of the people.";


Open in new window

Watch Question
This problem has been solved!
Unlock 2 Answers and 5 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE