The code below works fine on XAMPP on my PC, but doesn't work on my recently purchased VPS. He broke my code.
preg_match_all( "/$regex/siU" , $string , $matches , PREG_SET_ORDER );
It is expected that you simply get links and headings from HTML.
Earlier, a similar problem with regular expression arose today. The code worked fine on the local server, but generated a "Connection Was Reset" error on vps. The problem was caused by commented html (with php code inside it), which was removed using the code below to optimize the output, but the reset connection problem is resolved, HTML still has comments in the browser source.
$string = preg_replace( '//' , '' , $string );
So the problem is clear. These regular expressions are not working fine. But I do not know the solution.
Can anyone help me in resolving this issue.
It is decided:
Thanks to https://stackoverflow.com/a/4148773
source share