Савелей
Guest
Помогите с регулярными
перевод строки
Помогите с регулярными.
записываю в файл xml c сервера
$data_txt='http://exemple/file_.xml';
$f=file($data_txt) or die("нет");
for ($i=0, $y=count($f); $i<$y; $i++){
$info = rtrim($f[$i])."\n";
$fh=@fopen('file_.xml' , "w") or die("ошибка!");
fwrite($fh, $pr);
fclose($fh);
пример файла:
<offer id="5184">
<url>http://server/products_id/5184</url>
<price>100.0000</price>
<currencyId>USD</currencyId>
<categoryId>118</categoryId>
</orderingTime>
<name>0,5-5M</name>
<description>0,5-5M
bla-bla-bla
bla-bla-bla
bla-bla-bla</description>
</offer>
как между <description> убрать все переводы строк </description>
перевод строки
Помогите с регулярными.
записываю в файл xml c сервера
$data_txt='http://exemple/file_.xml';
$f=file($data_txt) or die("нет");
for ($i=0, $y=count($f); $i<$y; $i++){
$info = rtrim($f[$i])."\n";
$fh=@fopen('file_.xml' , "w") or die("ошибка!");
fwrite($fh, $pr);
fclose($fh);
пример файла:
<offer id="5184">
<url>http://server/products_id/5184</url>
<price>100.0000</price>
<currencyId>USD</currencyId>
<categoryId>118</categoryId>
</orderingTime>
<name>0,5-5M</name>
<description>0,5-5M
bla-bla-bla
bla-bla-bla
bla-bla-bla</description>
</offer>
как между <description> убрать все переводы строк </description>