
27-04-2007, 11:26
|
|
|
|
חבר מתאריך: 17.05.05
הודעות: 7,321
|
|
אז זה אותו רעיון...
קוד PHP:
$string = "<script>var i;</script><style>#MyDiv { ... } </style><font color='blue'>Hello!</font>";
$string = preg_replace("#<script>(.+?)</script>#", "", $string);
$string = preg_replace("#<style>(.+?)</style>#", "", $string);
echo $string; # output: "<font color='blue'>Hello!</font>"
אתה חייב ללמוד ביטויים רגולריים ושימוש בפונקציות המתאימות להם (בצע חיפוש)
|