I\'m learning PHP with some pre-made websites so I can see how it\'s done because I\'m a visual learner, but I\'ve run into a problem.
I got an error saying
The PHP documentation describes this function as
Perform a regular expression search and replace using a callback:
mixed preg_replace_callback ( mixed $pattern , callable $callback , mixed $subject [, int $limit = -1 [, int &$count ]] )
The callable
class requires the name of a function (as a string, e.g. 'print_r'
) or an actual function function(){ // do something }
.
The preg_replace_callback()
process will pass an array of matches into the "callable function" and return a string. From the docs, describing the second parameter:
A callback that will be called and passed an array of matched elements in the subject string. The callback should return the replacement string. This is the callback signature:
string handler ( array $matches )