I´m using a code to find a string inside a text this way:
$vista_previa_traducida = "[url]this is an url[/url]"
while (strpos($vista_previa_traducida, "[url]") != false) {
echo "I´m inside the conditional";
}
The code works fine but when the text starts with the string I´m finding, it doesn’t enter to the conditional. I don’t understand why, in this case the position is 0, so it should enter, but it doesn’t.
How can I fix this?