$char = '3';
$string = '101131110|101131110|';
$positions = array();
$pos = -1;
while (($pos = strpos($string, $char, $pos+1)) !== false) {
$positions[] = $pos+1;
}
$result = implode(',', $positions);
print_r($result);
The position of '3' in our string was 5,15
I want to get a second position of '3' in position 14 instead of 15, I had to pass this character "|"
anybody help me. thanks.
regards,
ivanichi