I'm trying to use preg_match in order to find a character.
What I wanted to do is:
1) trying to find the character ">"
2)if I find a character, then I want to count how many of this chracters found in the string.
My strings are from a textarea in a form.
Here is what I've done, but I couldn't get it to loop to count my character ">".
$k = 0;
$count_preg = array();
$string = $_POST['string'];
$preg = preg_match("/>/", $string);
if ($preg)
{
$count_preg[$k] = $string;
$k++;
}
echo "how many of these characters in the string? $k";
pls help.