ayrıştırıcı regex gibi Stackoverflow?

0 Cevap php

hello im makeing a parser in php as you can see below it transform

*this* _this_ gibi bir şey için this this

$db['profile']['information'] = str_replace( "\n" , "<br/>" , $db['profile']['information']);
$db['profile']['information'] = preg_replace('/\*([^\*]+)\*/', '<strong>\1</strong>', $db['profile']['information']);
$db['profile']['information'] = preg_replace('/_([^[_]+)_/', '<em>\1</em>', $db['profile']['information']);
$db['profile']['information'] = preg_replace('/\[img\]((?:[^\[]+|\[(?!img\]))*)\[img\]/', '<img src="\1" />', $db['profile']['information']);

Sorun img üzerinde olmasıdır.

örnek ben bir url var [img]123_460217980773_23232_11_*23123*_n.jpg[img] de bunu ayrıştırmak ne biliyorum. onun epik. Biri bana bunu çözmeye yardımcı olabilir?

ve zaman için teşekkürler arıyor

Adam Ramazan

0 Cevap