Knowledgebase

Portal Home > Knowledgebase > Articles Database > How to make replacement, only replacing once


How to make replacement, only replacing once




Posted by basketmen, 08-26-2011, 02:32 PM
Hi guys, below are custom code to replacing text into link, for example Google text, will be like this Google Yahoo text, will be like this Yahoo the replacement mod below are working well until now now i just need a little fix again, to make it better again i need it now only replacing once, so not too many links if the text appear few times please share your knowledge guys, how to do that

Posted by anythingss, 08-26-2011, 09:43 PM
i didnt spend much time looking at your code but adding the limit of 1 is probably all you need to do you can check php's documentation here: http://php.net/preg_replace

Posted by Acidx, 08-26-2011, 10:38 PM
either that or a loop to count and determine a set limit. very bad practice to tell you the truth.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read


Language:

Contact us