User Tools

Site Tools


uphp:functions:strpos

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
uphp:functions:strpos [2017/05/26 14:53]
jeff created
uphp:functions:strpos [2021/09/13 05:57] (current)
Line 31: Line 31:
 Note that string positions start at 0, and not 1. Note that string positions start at 0, and not 1.
  
-====Examples====+====Example====
  
 <code php> <code php>
 <? <?
-  $str='abcdef';+  $str='abcdefabcdef';
   $pos=strpos($str,'abc')   $pos=strpos($str,'abc')
   if ($pos>=0) {   if ($pos>=0) {
-    print("Substring found at position ".$pos);+    print("Substring found at position ".$pos); // 0
   }   }
 ?> ?>
Line 51: Line 51:
 [[strrpos()]] - Return the position of the last occurrence of a needle in a haystack [[strrpos()]] - Return the position of the last occurrence of a needle in a haystack
  
-[[strtolower()]] - Return the lowercase version of a string+[[strtolower()]] - Return the lowercase version of a <html><b><span style="color:green">string</b></html>
  
-[[strtoupper()]] - Return the uppercase version of a string+[[strtoupper()]] - Return the UPPERCASE version of a <html><b><span style="color:green">string</b></html>
  
-[[substr()]] - Return a sub-string of the passed str from start for len characters. If len is blank it will return the string until the end.+[[substr()]] - Return part of <html><b><span style="color:green">string</b></html>
  
-[[ucfirst()]] - Convert a string to lowercase except for the first character of each word+[[ucfirst()]] - Convert a <html><b><span style="color:green">string<span style="color:black"></b></html> to lowercase except for the first character
  
uphp/functions/strpos.1495810420.txt.gz · Last modified: 2021/09/13 05:56 (external edit)