Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $counter = 0;
- function testfunction() {
- global $counter;
- $counter++;
- return $counter;
- }
- $string = "* * * * * * * * * *";
- // If testfunction() is called multiple times, it should show an incrementing count
- // else it'll just show 1's.
- print str_replace("*", testfunction(), $string);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment