User Tools

Site Tools


uphp:functions:explode

Differences

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

Link to this comparison view

uphp:functions:explode [2017/04/12 12:54]
jeff
uphp:functions:explode [2021/09/13 05:57]
Line 1: Line 1:
-======explode====== 
- 
-<badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge> 
- 
-<html>Turn a <b><span style="color:green">string<span style="color:black"></b> into an <b><span style="color:green">array<span style="color:black"></b></html> 
- 
-====Description==== 
- 
-<well size="sm"> 
-<html> 
-<span style="font-size:125%;color:green">array 
-<span style="color:black"> 
-</html> 
-[[explode]] ( 
-<html> 
-<span style="color:green">string 
-<span style="color:blue">$value<span style="color:black">, 
-<span style="color:green">string 
-<span style="color:blue">$delimiter 
-<span style="color:black">) 
-</html> 
-</well> 
-<html>Turn a <b><span style="color:green">string<span style="color:black"></b> into an <b><span style="color:green">array<span style="color:black"></b> by separating out the elements as bounded by a delimiter character</html> 
- 
-====Parameters==== 
- 
-<html><b><span style="color:blue">$value<span style="color:black"></b>:  <b><span style="color:green">String<span style="color:black"></b> to be separated into elements in the <b><span style="color:green">array<span style="color:black"></b></html> 
- 
-<html><b><span style="color:blue">$delimiter<span style="color:black"></b></html>:  Character to use for separation 
- 
-====Return Value==== 
- 
-<html><b><span style="color:green">Array<span style="color:black"></b></html> of elements 
- 
-====Example==== 
- 
-<code php> 
-<pre><? 
-  $mylist="one,two,three,four"; 
-  $myarray=explode($mylist,","); 
-  print_r($myarray); 
-?></pre> 
-</code> 
- 
-The above example will output: 
-<code> 
-[$myarray] = Array ( 
-(string) [0] => one 
-(string) [1] => two 
-(string) [2] => three 
-(string) [3] => four 
- 
-</code> 
- 
-====See Also==== 
- 
-[[implode()]] - <html>Turn an <b><span style="color:green">array<span style="color:black"></b> into a <b><span style="color:green">string<span style="color:black"></b></html> 
- 
-[[print_r()]] - Dump the contents of an <html><b><span style="color:green">array<span style="color:black"></b></html> to the current output 
- 
-[[sizeof()]] - Return the number of elements in an <html><b><span style="color:green">array<span style="color:black"></b></html> 
- 
-[[uphp:variables|uPHP Variable Types and Limits]] 
- 
-====Additional Information==== 
- 
-Note that there is an important difference in the parameter order between mainline PHP and Wattmon uPHP. In the mainline PHP function the delimiter comes first, but in uPHP the <html><b><span style="color:green">string<span style="color:black"></b></html> to be exploded comes first: 
- 
-<badge>PHP</badge> ''explode(delimiter,string)'' 
- 
-<badge>uPHP</badge> ''explode(string,delimiter)'' 
- 
-Wattmon uPHP's parameter order is easier to remember and more consistent:  The delimiter parameter comes last in both [[explode()]] and [[implode()]]. 
  
uphp/functions/explode.txt · Last modified: 2021/09/13 05:57 (external edit)