Page 1 of 1

help needed in logic

Posted: Thu Oct 29, 2009 12:44 am
by samyphp
hi there,

i want to replace the 'n' number of dots in following content to '3' dots ('...'). this is a dynamic content. i am stuck here. please anybody help me.

"Technology is a broad concept that....................... deals with human as well as other animal species' usage and knowledge of tools and crafts, and.................... how it affects a species' ability to control and adapt.................................................. to its environment. Technology is a term with origins in the Greek technología (τεχνολογία) — téchnē (τέχνη), 'craft' and -logía (-λογία), the study of something, or the branch of knowledge................... of a discipline.[1] However, a strict.......................... definition is elusive; "technology" can refer to material objects of use to humanity, such as ........machines, hardware or utensils, but can also encompass broader themes, including sys...............................................tems, methods of organization, and techniques. The term can either be applied generally or to specific areas: examples....................................................................... include "construction technology", "medical technology", or "state-of-the-art technology"

thanks,
Palanisamy

Re: help needed in logic

Posted: Thu Oct 29, 2009 6:40 pm
by Jonah Bron

Code: Select all

while (strpos($text, '....') !== false){
    $text = str_replace('....', '...', $text);
}
BTW, you should post in the code forum.