Hi, I'm getting this error: (2) preg_replace_callback(): Requires argument 2, '', to be a valid callback Here's the line where the problem is: $file_contents = preg_replace_callback("!{$ldq}\*.*?\*{$rdq}!se","",$file_contents); I think it has something to do with an upgrade in the PHP. How do I correct this problem? Any help would be greatly appreciated.
Read the manual. http://php.net/manual/en/function.preg-replace-callback.php You're missing the callback.
To be honest I'm trying to fix a problem in a script which I did not create. My coding skills are extremely limited. How exactly do I add the callback?
Well, if you just want the original script to work, you can try changing preg_replace_callback with just preg_replace? Try this: $file_contents = preg_replace("!{$ldq}\*.*?\*{$rdq}!se","",$file_contents); Code (markup):
I get this error when I change it back to how it originally was. (8192) preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead
I'm trying to setup the Arfooo directory script on Godaddy shared hosting. Here's a screenshot of the error I get immediately after setup. https://s16.postimg.org/d90l8dxcl/preg_replace.jpg
The second parameter of the preg_replace_callback has to be a function that'll accept one parameter and return the processed value. More visually: function mycallbackfunc($text){ // Do something with $text // Then return your value }
If you need to do it quickly, use this (I removed the e options): $file_contents = preg_replace("!{$ldq}\*.*?\*{$rdq}!s","",$file_contents); Code (markup):
Hi, When i click on "Solved! View solution." in the first post, i have an error message : Digital Point - Error You do not have permission to view this page or perform this action. Thanks for any help