$a1 = preg_replace("/keyword1/", "<a href='http://keyword.com'>keyword</a>", "$a", 1); $a2 = preg_replace("/keyword1/", "<a href='http://keyword1.com'>keyword1</a>", "$a1", 1); $a3 = preg_replace("/keyword1/", "<a href='http://keyword2.com'>keyword2</a>", "$a2", 1); ........... ......... ....etc ... //the numbers of 1K line $a1000 = preg_replace("/keyword1/", "<a href='http://keyword999.com'>keyword999</a>", "$a999", 1); 1K preg_replace line, 80KB of php file. server will heavy load or not? thank you
This wont take much load for sure. This is just string processing. The data is already there and its not taking much resources like mysql or connection to other webpages.
Just a small observation: You only need to place string operators around strings, not around the variables or non-string literal values within functions. If you still wish to make your programming more efficient and resourceful, you may be able reduce the server load by a small amount if you look up functions and their alternatives (if any) to compare their CPU and memory usages as well as omitting any unnecessary operators.