You should be able to use an Anonymous Function (aka Closure) with a call to the parent scoped $delimiter
variable, like so:
$callbacks[$delimiter] = function($matches) use ($delimiter) {
return $delimiter . strtolower($matches[1]);
};
More Related Contents:
- xss attack on a php page
- Creating sign-in with my site functionality
- When should I use ‘self’ over ‘$this’?
- Is there a function to extract a ‘column’ from an array in PHP?
- How to properly set up a PDO connection
- Allow php sessions to carry over to subdomains
- What is output buffering?
- What does the variable $this mean in PHP?
- How to POST JSON Data With PHP cURL?
- how to upload file using curl with PHP [closed]
- Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result [duplicate]
- Are PHP include paths relative to the file or the calling code?
- PHP 5 disable strict standards error
- recursive array_diff()?
- How to convert mysqli result to JSON? [duplicate]
- PHP & MySQL Pagination
- Check whether image exists on remote URL
- Symfony: Clear doctrine cache
- Why is textarea filled with mysterious white spaces?
- In PHP, what is the differences between NULL and setting a string to equal 2 single quotes
- Group 2d array rows by one column and sum another column [duplicate]
- Using LIKE in bindParam for a MySQL PDO Query [duplicate]
- PHP: Detect Page Refresh
- How to solve Error 404 when deploying laravel project to Cpanel?
- Reading mp4 files with PHP
- OpenSSL not working on Windows, errors 0x02001003 0x2006D080 0x0E064002
- understanding php curl_multi_exec
- How do I generate a custom menu/sub-menu system using wp_get_nav_menu_items in WordPress?
- Why does an infinitely recursive function in PHP cause a segfault?
- How to get the shortest rather than longest possible regex match with preg_match()