Bug #77386 [Com]: The result is different than it should be.
Edit report at https://bugs.php.net/bug.php?id=77386&edit=1
ID: 77386
Comment by: mega6382 at mega6382 dot me
Reported by: maikcrew at centrum dot cz
Summary: The result is different than it should be.
Status: Open
Type: Bug
Package: Unknown/Other Function
Operating System: Debian
PHP Version: 7.2.13
Block user comment: N
Private report: N
New Comment:
You should use mb_strpos for this http://php.net/manual/en/function.mb-strpos.php
Because your string contains multibyte characters
Example: https://3v4l.org/epioV
Previous Comments:
------------------------------------------------------------------------
[2018-12-31 10:32:37] maikcrew at centrum dot cz
Description:
------------
---
From manual page: https://php.net/function.strpos
---
Test script:
---------------
<?php
$ÅetÄzec = "\"Babylónská rybka,\" odÅÃkával tiÅ¡e
StopaÅův průvodce po Galaxii";
$pozice = strpos($ÅetÄzec, "rybka");
echo "Hledané slovo zaÄÃná na pozici $pozice";
?>
Expected result:
----------------
pozice = 12 but php show 14 ? I study book. When I try count position manualy look that is 12.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77386&edit=1
Thread (4 messages)