Hi,
In the text below($sData) I'm trying to change the variable $iQuality from 90 to 100, unfortunately it doesn't work, I know where the problem lies, I just don't know how to solve it.
$sReplace = "\1".$iQuality;
Because $iQuality is an integer the pattern becomes \1100, this doesn't work ofcourse, and the 2nd line in $sData changes
into $00;
Anyone who knows the solution?
Thanks a lot!
<?php
$sData = "\$aBaba = 9;\n";
$sData .= "\$iQuality = 90;\n";
$sData .= "\$aBaygjhba = 9;\n";
$iQuality = 100;
$sPattern = "/(iQuality = )(\d+)/";//
$sReplace = "\1".$iQuality;
$sData = preg_replace($sPattern,$sReplace,$sData);
echo nl2br($sData);
?>