Sasa Posted May 24, 2006 Report Share Posted May 24, 2006 kaa var atljaut lapaa izmantot tikai atljautos HTML tagus nevis visus kas ienaak praataa? vareetu atlajut tikai . .. ka kaut ko shaadu var dabuut gatavu? Link to comment Share on other sites More sharing options...
Vebers Posted May 24, 2006 Report Share Posted May 24, 2006 HTML tagus var izgriezt ar strip_tags();, bet lai attēlotu tos izmanto htmlspecialchars();. Bet utt skaitās nevis HTML tagi, bet gan BBcode. Lai tos aizvietotu izmanto reg-exp Link to comment Share on other sites More sharing options...
Sasa Posted May 24, 2006 Author Report Share Posted May 24, 2006 cik sapratu ja es ielieku strip_tags() tad vinsh grieziis piniigi visus tagus araa kas ir iespeejami! bet nesaprotu kaa darbojas tas htmlspecialchars() kur es vinjam noraadu kaadsu BBcode tagus laist cauri Link to comment Share on other sites More sharing options...
Jackal Posted May 24, 2006 Report Share Posted May 24, 2006 $comment = preg_replace('~\[i\](.*?)\[\/i\]~is', '<i>\\1</i>', $comment); $comment = preg_replace('~\[b\](.*?)\[\/b\]~is', '<b>\\1</b>', $comment); $comment = preg_replace('~\[u\](.*?)\[\/u\]~is', '<u>\\1</u>', $comment); Link to comment Share on other sites More sharing options...
Recommended Posts