$string = "comment-454";
I want to disply only 454? not comment-
i am saving in db comment-454 , now i want to crop comment-.. how can i
can someone provide me something, because i am newbie in php.. thanks in advance..
$string = "comment-454";
I want to disply only 454? not comment-
i am saving in db comment-454 , now i want to crop comment-.. how can i
can someone provide me something, because i am newbie in php.. thanks in advance..
$string = str_replace("comment-", "", "comment-454");
should replace what you want.
you mentioned comment-454
came from your database. So ill assume it's in $result
.
Now you can do:
$string = str_replace("comment-", "", $result);
echo $string;
Use explote() http://php.net/manual/de/function.explode.php
$teile = explode("-", $string); echo $teile[1]; // 454