From a5ee6bad2fbf3550a20667ab1218afd4ff28b25f Mon Sep 17 00:00:00 2001 From: Ken Date: Thu, 1 Jan 2004 22:53:19 +0000 Subject: [PATCH] Added example of offsets. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@147652 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/strings/functions/strpos.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reference/strings/functions/strpos.xml b/reference/strings/functions/strpos.xml index 682ed058fc..6c2d394a41 100644 --- a/reference/strings/functions/strpos.xml +++ b/reference/strings/functions/strpos.xml @@ -1,5 +1,5 @@ - + @@ -50,6 +50,9 @@ if ($pos === false) { echo " and exists at position $pos"; } +// We can search for the character, ignoring anything before the offset +$newstring = 'abcdef abcdef'; +$pos = strpos($newstring, 'a', 1); // $pos = 7, not 0 ?> ]]>