Jump to content
php.lv forumi

str linka noslepsana


Mikijs

Recommended Posts

pienjemsim ka man ir strings

$str="Mana mīlākā mājas lapa <a href=\"http://www.php.lv\">http://www.php.lv</a> un lapas forums atrodās <a href=\"http://www.php.lv/f\">http://www.php.lv/f</a> nāciet ciemos.";

Kā lai es dabūnu pieņemsim šādu tekstu

$str="Mana mīlākā mājas lapa <u>http://www.php.lv</u> un lapas forums atrodās <u>http://www.php.lv/f</u> nāciet ciemos.";

Link to comment
Share on other sites

izmantoju sekojosho kodu bet man nesanaca ta vai ta..

 

						  $htmlbody = str_replace("<a href=\"/[^a-zA-Z0-9s]/\"", "", $htmlbody);
					  $htmlbody = str_replace("title=\"/[^a-zA-Z0-9s]/\"", "", $htmlbody);
					  $htmlbody = str_replace("class=\"/[^a-zA-Z0-9s]/\"", "", $htmlbody);
					  $htmlbody = str_replace("id=\"/[^a-zA-Z0-9s]/\"", "", $htmlbody);
					  $htmlbody = str_replace("target=\"_blank\">", "", $htmlbody);
					  $htmlbody = str_replace("</a>", "", $htmlbody);

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...