Why does \\1 inherit (.*) instead of replacing it? ? ?
 
  2018-01-29 15:51:29
0
1
1645

<?php

$string='[b]Write poems for you[/b]

[i]Do impossible things for you[/i]

$pattern=array(

'/\[b\](.*)\[\/b\]/i',

'/\[i\]( .*)\[\/i\]/iU',

);

$replace=array(

'<b>\\1</b> ;<br />',

'<i>\\1</i><br />',

);

$ ubb=preg_replace($pattern,$replace,$string);

echo $ubb;

Why does \\1 inherit (.*) instead of replacing it? ? ?


 
 

reply all(1)
 

Is it possible that only replacement can contain back references\\nIs this explanation? That means it's fixed?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template