24 lines
1.0 KiB
PHP
24 lines
1.0 KiB
PHP
|
<?php
|
||
|
|
||
|
$text = '<p align="center" style="margin-left:30.0pt;text-align:center; </b></p> <p align=center style=" text-align:center;text-align:justify;text-justify:="" inter-ideograph;mso-list:l2="" level1="" lfo1\'="">1. Операции над матрицами, их свойства.</p>
|
||
|
<p> <br></p>
|
||
|
<p style="margin-left:21.3pt;text-align:justify;text-justify: inter-ideograph;mso-list:l2 level1 lfo1">2. Определители квадратных матриц, свойства определителей.</p>';
|
||
|
|
||
|
echo htmlspecialchars($text).'<hr>';
|
||
|
|
||
|
//$text1 = preg_replace('|<(?!.*>)<|isU','<-$1-><',$text);
|
||
|
function check_te($itt){
|
||
|
if(strpos($itt[1],'>')===false)
|
||
|
return '<'.$itt[1].'><';
|
||
|
else
|
||
|
return '<'.$itt[1].'<';
|
||
|
}
|
||
|
$text1 = preg_replace_callback('|<(.*)<|isU',"check_te",$text);
|
||
|
$text1 = preg_replace_callback('|="(.*)>|isU',function ($itt){
|
||
|
if(substr_count($itt[1],'"')%2 == 0) {
|
||
|
return '="' . $itt[1] . '">';
|
||
|
}else {
|
||
|
return '="' . $itt[1] . '>';
|
||
|
}
|
||
|
},$text1);
|
||
|
echo htmlspecialchars($text1);
|