From 30a6ab9bdf79fa7dac5975878cd9a0c818708929 Mon Sep 17 00:00:00 2001 From: Matt Li Date: Sun, 25 Dec 2011 02:27:36 +0000 Subject: [PATCH] Fix as per note #106986 and unify format between related functions git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@321383 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/strings/functions/stripos.xml | 26 +++++++++++++----------- reference/strings/functions/strpos.xml | 23 +++++++++++---------- reference/strings/functions/strripos.xml | 22 ++++++++++++-------- reference/strings/functions/strrpos.xml | 19 ++++++++++------- reference/strings/functions/strstr.xml | 2 +- 5 files changed, 52 insertions(+), 40 deletions(-) diff --git a/reference/strings/functions/stripos.xml b/reference/strings/functions/stripos.xml index e8f13f34aa..8fdde710b0 100644 --- a/reference/strings/functions/stripos.xml +++ b/reference/strings/functions/stripos.xml @@ -3,7 +3,7 @@ stripos - Find position of first occurrence of a case-insensitive string + Find the position of the first occurrence of a case-insensitive substring in a string @@ -15,12 +15,11 @@ intoffset0 - Returns the numeric position of the first occurrence of - needle in the haystack - string. + Find the numeric position of the last occurrence of + needle in the haystack string. - Unlike strpos, stripos is + Unlike the strpos, stripos is case-insensitive. @@ -33,7 +32,7 @@ haystack - The string to search in + The string to search in. @@ -54,10 +53,9 @@ offset - The optional offset parameter allows you - to specify which character in haystack to - start searching. The position returned is still relative to the - beginning of haystack. + If specified, search will start this number of characters counted from + the beginning of the string. Unlike strrpos and + strripos, the offset cannot be negative. @@ -68,8 +66,12 @@ &reftitle.returnvalues; - Returns the position as an integer. If needle is not found, - stripos will return boolean &false;. + Returns the position of where the needle exists relative to the beginnning of + the haystack string (independent of offset). + Also note that string positions start at 0, and not 1. + + + Returns &false; if the needle was not found. &return.falseproblem; diff --git a/reference/strings/functions/strpos.xml b/reference/strings/functions/strpos.xml index 6e4d9a4d04..677acaa8fb 100644 --- a/reference/strings/functions/strpos.xml +++ b/reference/strings/functions/strpos.xml @@ -3,7 +3,7 @@ strpos - Find position of first occurrence of a string + Find the position of the first occurrence of a substring in a string @@ -15,9 +15,8 @@ intoffset0 - Returns the numeric position of the first occurrence of - needle in the haystack - string. + Find the numeric position of the last occurrence of + needle in the haystack string. @@ -46,10 +45,9 @@ offset - The optional offset parameter allows you - to specify which character in haystack to - start searching. The position returned is still relative to the - beginning of haystack. + If specified, search will start this number of characters counted from + the beginning of the string. Unlike strrpos and + strripos, the offset cannot be negative. @@ -60,9 +58,12 @@ &reftitle.returnvalues; - Returns the position as an integer. If needle is - not found, strpos will return boolean - &false;. + Returns the position of where the needle exists relative to the beginnning of + the haystack string (independent of offset). + Also note that string positions start at 0, and not 1. + + + Returns &false; if the needle was not found. &return.falseproblem; diff --git a/reference/strings/functions/strripos.xml b/reference/strings/functions/strripos.xml index e0f6f1a602..5c82b22d1d 100644 --- a/reference/strings/functions/strripos.xml +++ b/reference/strings/functions/strripos.xml @@ -3,7 +3,7 @@ strripos - Find position of last occurrence of a case-insensitive string in a string + Find the position of the last occurrence of a case-insensitive substring in a string @@ -15,8 +15,11 @@ intoffset0 - Find position of last occurrence of a string in a string. Unlike - strrpos, strripos is + Find the numeric position of the last occurrence of + needle in the haystack string. + + + Unlike the strrpos, strripos is case-insensitive. @@ -46,9 +49,9 @@ offset - If specified, search will stop this number of characters counted from the + If specified, search will start this number of characters counted from the beginning of the string. If the value is negative, search will instead start - from that many characters from the end of the string. + from that many characters from the end of the string, searching backwards. @@ -59,12 +62,13 @@ &reftitle.returnvalues; - Returns the numerical position of the last occurrence of - needle. Also note that string positions start at 0, - and not 1. + Returns the position where the needle exists relative to the beginnning of + the haystack string (independent of search direction + or offset). + Also note that string positions start at 0, and not 1. - If needle is not found, &false; is returned. + Returns &false; if the needle was not found. &return.falseproblem; diff --git a/reference/strings/functions/strrpos.xml b/reference/strings/functions/strrpos.xml index e390a83793..c98fbe840c 100644 --- a/reference/strings/functions/strrpos.xml +++ b/reference/strings/functions/strrpos.xml @@ -15,9 +15,8 @@ intoffset0 - Returns the numeric position of the last occurrence of - needle in the haystack - string. + Find the numeric position of the last occurrence of + needle in the haystack string. @@ -46,9 +45,9 @@ offset - If specified, search will stop this number of characters counted from the + If specified, search will start this number of characters counted from the beginning of the string. If the value is negative, search will instead start - from that many characters from the end of the string. + from that many characters from the end of the string, searching backwards. @@ -59,9 +58,15 @@ &reftitle.returnvalues; - Returns the position where the needle exists. Returns &false; if the needle - was not found. + Returns the position where the needle exists relative to the beginnning of + the haystack string (independent of search direction + or offset). + Also note that string positions start at 0, and not 1. + + Returns &false; if the needle was not found. + + &return.falseproblem; diff --git a/reference/strings/functions/strstr.xml b/reference/strings/functions/strstr.xml index 61b41cb23f..470d518a06 100644 --- a/reference/strings/functions/strstr.xml +++ b/reference/strings/functions/strstr.xml @@ -3,7 +3,7 @@ strstr - Find first occurrence of a string + Find the first occurrence of a string