User Tools

Site Tools


uphp:functions

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
uphp:functions [2019/12/20 09:21]
admin
uphp:functions [2021/11/15 04:08]
admin
Line 2: Line 2:
  
 uPHP functions have an identical syntax to PHP functions in most cases. Below is a list of all the functions that have been implemented. uPHP functions have an identical syntax to PHP functions in most cases. Below is a list of all the functions that have been implemented.
 +
 +Certain additional functions are available as WattmonOS include files.  For a list of these see [[.library_functions:library_functions]].
  
 Click on the function name for further details: Click on the function name for further details:
Line 12: Line 14:
 |[[.functions:array_key]]|<html><span style="color:green">array<span style="color:black">, <span style="color:green"> int<span style="color:blue"> index</html>|<html><span style="color:green">string<span style="color:black"> key</html>|<html>Return the key for an <span style="color:green">array <span style="color:blue">index</html>| |[[.functions:array_key]]|<html><span style="color:green">array<span style="color:black">, <span style="color:green"> int<span style="color:blue"> index</html>|<html><span style="color:green">string<span style="color:black"> key</html>|<html>Return the key for an <span style="color:green">array <span style="color:blue">index</html>|
 |[[.functions:array_keys]]|<html><span style="color:green">array<span style="color:black"> with key/value pairs</html>|<html><span style="color:green">array<span style="color:black"> of keys</html>|<html>Return keys for an <span style="color:green">array<span style="color:black"> that has key/value pairs</html>| |[[.functions:array_keys]]|<html><span style="color:green">array<span style="color:black"> with key/value pairs</html>|<html><span style="color:green">array<span style="color:black"> of keys</html>|<html>Return keys for an <span style="color:green">array<span style="color:black"> that has key/value pairs</html>|
 +|[[.functions:array_resize]]|<html><span style="color:green">array<span style="color:black"> indexed array, <span style="color:green">int<span style="color:black"> length</html>|none|<html>Resize indexed <span style="color:green">array<span style="color:black"> </html>|
 |[[.functions:base64_decode]]|<html><span style="color:green">string<span style="color:blue"> base64</html>|<html><span style="color:green">string<span style="color:black"> decoded or <span style="color:green">int<span style="color:black"> 0</html>|<html>Decode a base64-encoded <span style="color:green">string</html>| |[[.functions:base64_decode]]|<html><span style="color:green">string<span style="color:blue"> base64</html>|<html><span style="color:green">string<span style="color:black"> decoded or <span style="color:green">int<span style="color:black"> 0</html>|<html>Decode a base64-encoded <span style="color:green">string</html>|
 |[[.functions:base64_encode]]|<html><span style="color:green">string<span style="color:black"> to encode</html>|<html><span style="color:green">string<span style="color:black"> base64 or <span style="color:green">int<span style="color:black"> 0</html>|<html>Return the base64-encoded version of a <span style="color:green">string</html>| |[[.functions:base64_encode]]|<html><span style="color:green">string<span style="color:black"> to encode</html>|<html><span style="color:green">string<span style="color:black"> base64 or <span style="color:green">int<span style="color:black"> 0</html>|<html>Return the base64-encoded version of a <span style="color:green">string</html>|
Line 26: Line 29:
 |[[.functions:disk_status]]|<html><span style="color:green">int<span style="color:blue"> drive</html>|<html><span style="color:green">int<span style="color:black"> Status</html>|Return mount status of drive| |[[.functions:disk_status]]|<html><span style="color:green">int<span style="color:blue"> drive</html>|<html><span style="color:green">int<span style="color:black"> Status</html>|Return mount status of drive|
 |[[.functions:disk_total_space]]|<html><span style="color:green">int<span style="color:blue"> drive</html>|<html><span style="color:green">int<span style="color:black"> KiloBytes</html>|Return total space on drive| |[[.functions:disk_total_space]]|<html><span style="color:green">int<span style="color:blue"> drive</html>|<html><span style="color:green">int<span style="color:black"> KiloBytes</html>|Return total space on drive|
 +|[[.functions:download]]|<html><span style="color:green">string<span style="color:blue"> url</html>|<html><span style="color:green">int<span style="color:black"> res</html>|Download a file in the background|
 +|[[.functions:download_info]]||<html><span style="color:green">array<span style="color:black"> info</html>|Get info about ongoing download|
 +|[[.functions:download_state]]||<html><span style="color:green">int<span style="color:black"> status</html>|Get state of download|
 |[[.functions:error_reporting]]|<html><span style="color:green">int<span style="color:blue"> verbosity</html>||Set the debug output level| |[[.functions:error_reporting]]|<html><span style="color:green">int<span style="color:blue"> verbosity</html>||Set the debug output level|
 +|[[.functions:ereg]]|<html><span style="color:green">string<span style="color:blue"> pattern<span style="color:black">,<span style="color:green"> string<span style="color:blue"> content [,<span style="color:green"> &amp;array<span style="color:blue"> matches]</html>|<html><span style="color:green">int</html>|<html>Perform a regex operation</html>|
 |[[.functions:exec]]|<html><span style="color:green">string<span style="color:blue"> script<span style="color:black">,<span style="color:green"> int<span style="color:blue"> delay</html>||<html>Run a <span style="color:blue">script<span style="color:black"> with an optional <span style="color:blue">delay</html>| |[[.functions:exec]]|<html><span style="color:green">string<span style="color:blue"> script<span style="color:black">,<span style="color:green"> int<span style="color:blue"> delay</html>||<html>Run a <span style="color:blue">script<span style="color:black"> with an optional <span style="color:blue">delay</html>|
 |[[.functions:exec_action]]|<html><span style="color:green">mixed<span style="color:blue"> action</html>|<html><span style="color:green">int<span style="color:black"> 1=OK</html>|<html>Triggers a manually executable <span style="color:blue">action<span style="color:black"> by id or name</html>| |[[.functions:exec_action]]|<html><span style="color:green">mixed<span style="color:blue"> action</html>|<html><span style="color:green">int<span style="color:black"> 1=OK</html>|<html>Triggers a manually executable <span style="color:blue">action<span style="color:black"> by id or name</html>|
Line 43: Line 50:
 |[[.functions:fopen]]|<html><span style="color:green">string<span style="color:blue"> filename<span style="color:black">,<span style="color:green"> string<span style="color:blue"> mode</html>|<html><span style="color:green">int<span style="color:black"> handle or 0</html>|Open a file for reading or writing| |[[.functions:fopen]]|<html><span style="color:green">string<span style="color:blue"> filename<span style="color:black">,<span style="color:green"> string<span style="color:blue"> mode</html>|<html><span style="color:green">int<span style="color:black"> handle or 0</html>|Open a file for reading or writing|
 |[[.functions:fread]]|<html><span style="color:green">int<span style="color:blue"> handle<span style="color:black">,<span style="color:green"> int<span style="color:blue"> bytes</html>|<html><span style="color:green">string<span style="color:black"> or <span style="color:green">int<span style="color:black"> 0</html>|<html>Read <span style="color:blue">bytes<span style="color:black"> from a file, stream or socket</html>| |[[.functions:fread]]|<html><span style="color:green">int<span style="color:blue"> handle<span style="color:black">,<span style="color:green"> int<span style="color:blue"> bytes</html>|<html><span style="color:green">string<span style="color:black"> or <span style="color:green">int<span style="color:black"> 0</html>|<html>Read <span style="color:blue">bytes<span style="color:black"> from a file, stream or socket</html>|
 +|[[.functions:fread_unpack]]|<html><span style="color:green">int<span style="color:blue"> handle<span style="color:black">,<html><span style="color:green">string<span style="color:blue"> format<span style="color:black">, <span style="color:green">int <span style="color:blue"> count<span style="color:black">, <span style="color:green">int <span style="color:blue"> interval<span style="color:black"></html> |<html><span style="color:green">number</html>|<html>Write contents of an indexed array to a file in binary<span style="color:black"></html>|
 |[[.functions:freemem]]||<html><span style="color:green">int<span style="color:black"> bytes</html>|Return free memory space| |[[.functions:freemem]]||<html><span style="color:green">int<span style="color:black"> bytes</html>|Return free memory space|
 |[[.functions:freestack]]||<html><span style="color:green">int<span style="color:black"> bytes</html>|Return free stack space| |[[.functions:freestack]]||<html><span style="color:green">int<span style="color:black"> bytes</html>|Return free stack space|
Line 57: Line 65:
 |[[.functions:ftp_is_connecting]]|<html><span style="color:green">int<span style="color:blue"> result</html>|| Check if the FTP connection is in the process of connecting| |[[.functions:ftp_is_connecting]]|<html><span style="color:green">int<span style="color:blue"> result</html>|| Check if the FTP connection is in the process of connecting|
 |[[.functions:ftp_list]]|<html><span style="color:green">int<span style="color:blue"> result</html>|<html><span style="color:green">string<span style="color:black"> folder</html>, <html><span style="color:green">string<span style="color:black"> output_file</html>|Lists a folder on the FTP server and outputs the result to the specified file| |[[.functions:ftp_list]]|<html><span style="color:green">int<span style="color:blue"> result</html>|<html><span style="color:green">string<span style="color:black"> folder</html>, <html><span style="color:green">string<span style="color:black"> output_file</html>|Lists a folder on the FTP server and outputs the result to the specified file|
-|[[.functions:ftp_open]]|<html><span style="color:green">int<span style="color:blue"> result</html>|<html><span style="color:green">string<span style="color:black"> host</html>, <html><span style="color:green">int<span style="color:black"> port</html>, <html><span style="color:green">string<span style="color:black"> username</html>, <html><span style="color:green">string<span style="color:black"> password</html>|Open a connection to an FTP server|+|[[.functions:ftp_open]]|<html><span style="color:green">int<span style="color:blue"> result</html>|<html><span style="color:green">string<span style="color:black"> host</html>, <html><span style="color:green">int<span style="color:black"> port</html>, <html><span style="color:green">string<span style="color:black"> username</html>, <html><span style="color:green">string<span style="color:black"> password</html>, <html><span style="color:green">int<span style="color:black"> keepalive</html>, <html><span style="color:green">int<span style="color:black"> ignore_reply</html>|Open a connection to an FTP server|
 |[[.functions:ftp_size]]|<html><span style="color:green">int<span style="color:blue"> size</html>|<html><span style="color:green">string<span style="color:black"> filename</html>|Get the file size of a file on the FTP server| |[[.functions:ftp_size]]|<html><span style="color:green">int<span style="color:blue"> size</html>|<html><span style="color:green">string<span style="color:black"> filename</html>|Get the file size of a file on the FTP server|
 |[[.functions:ftp_status]]|<html><span style="color:green">array<span style="color:blue"> status</html>||Get the FTP engine status including upload and download completion information |[[.functions:ftp_status]]|<html><span style="color:green">array<span style="color:blue"> status</html>||Get the FTP engine status including upload and download completion information
Line 63: Line 71:
 |[[.functions:function_exists]]|<html><span style="color:green">string<span style="color:blue"> function_name</html>|<html><span style="color:green">int<span style="color:black"> 1 or 0</html>|Check if a function exists (custom or native)| |[[.functions:function_exists]]|<html><span style="color:green">string<span style="color:blue"> function_name</html>|<html><span style="color:green">int<span style="color:black"> 1 or 0</html>|Check if a function exists (custom or native)|
 |[[.functions:fwrite]]|<html><span style="color:green">int<span style="color:blue"> handle<span style="color:black">, <span style="color:green">mixed <span style="color:blue">data<span style="color:black">, <span style="color:green">int <span style="color:blue">length</html>|<html><span style="color:green">int<span style="color:black"> bytes written or -1</html>|<html>Write <span style="color:blue">data<span style="color:black"> to a file, stream or socket</html>| |[[.functions:fwrite]]|<html><span style="color:green">int<span style="color:blue"> handle<span style="color:black">, <span style="color:green">mixed <span style="color:blue">data<span style="color:black">, <span style="color:green">int <span style="color:blue">length</html>|<html><span style="color:green">int<span style="color:black"> bytes written or -1</html>|<html>Write <span style="color:blue">data<span style="color:black"> to a file, stream or socket</html>|
 +|[[.functions:fwrite_pack]]|<html><span style="color:green">int<span style="color:blue"> handle<span style="color:black">,<html><span style="color:green">array<span style="color:blue"> data<span style="color:black">, <span style="color:green">int <span style="color:blue"> length<span style="color:black"></html> |<html><span style="color:green">number</html>|<html>Write contents of an indexed array to a file in binary<span style="color:black"></html>|
 |[[.functions:get3gstat]]||<html><span style="color:green">array</html>|Get cellular data connection status information| |[[.functions:get3gstat]]||<html><span style="color:green">array</html>|Get cellular data connection status information|
 |[[.functions:getcwd]]||<html><span style="color:green">string<span style="color:black"> path</html>|Get the current directory| |[[.functions:getcwd]]||<html><span style="color:green">string<span style="color:black"> path</html>|Get the current directory|
 |[[.functions:getethstat]]||<html><span style="color:green">array</html>|Get Ethernet connection status information| |[[.functions:getethstat]]||<html><span style="color:green">array</html>|Get Ethernet connection status information|
 |[[.functions:getmac]]||<html><span style="color:green">string<span style="color:black"> MAC</html>|Get the Wattmon's MAC address| |[[.functions:getmac]]||<html><span style="color:green">string<span style="color:black"> MAC</html>|Get the Wattmon's MAC address|
 +|[[.functions:gettype]]|<html><span style="color:green">any<span style="color:blue"> variable<span style="color:black"></html>|<html><span style="color:green">string<span style="color:black"> type</html>|Get a variable type as a string|
 |[[.functions:getusbstat]]||<html><span style="color:green">array</html>|Get USB host status information| |[[.functions:getusbstat]]||<html><span style="color:green">array</html>|Get USB host status information|
 |[[.functions:getwifistat]]||<html><span style="color:green">array</html>|Get WIFI status information| |[[.functions:getwifistat]]||<html><span style="color:green">array</html>|Get WIFI status information|
Line 89: Line 99:
 |[[.functions:is_string]]|<html><span style="color:green">mixed<span style="color:blue"> variable</html>|<html><span style="color:green">int<span style="color:black"> 1 or 0</html>|<html>Check if a <span style="color:blue">variable<span style="color:black"> is a <span style="color:green">string</html>| |[[.functions:is_string]]|<html><span style="color:green">mixed<span style="color:blue"> variable</html>|<html><span style="color:green">int<span style="color:black"> 1 or 0</html>|<html>Check if a <span style="color:blue">variable<span style="color:black"> is a <span style="color:green">string</html>|
 |[[.functions:isset]]|<html><span style="color:green">mixed<span style="color:blue"> variable</html>|<html><span style="color:green">int<span style="color:black"> 1 or 0</html>|<html>Check if a <span style="color:blue">variable<span style="color:black"> exists</html>| |[[.functions:isset]]|<html><span style="color:green">mixed<span style="color:blue"> variable</html>|<html><span style="color:green">int<span style="color:black"> 1 or 0</html>|<html>Check if a <span style="color:blue">variable<span style="color:black"> exists</html>|
 +|[[.functions:json_decode]]|<html><span style="color:green">string<span style="color:black"></html>|<html><span style="color:green">array</html>|<html>JSON decode a <span style="color:green">string<span style="color:black"> into an <span style="color:green">array<span style="color:black"></html>|
 |[[.functions:json_encode]]|<html><span style="color:green">array<span style="color:black">,<span style="color:green"> int<span style="color:blue"> method</html>|<html><span style="color:green">string</html>|<html>JSON encode an <span style="color:green">array<span style="color:black"> into a <span style="color:green">string<span style="color:black">, with optional <span style="color:blue">method</html>| |[[.functions:json_encode]]|<html><span style="color:green">array<span style="color:black">,<span style="color:green"> int<span style="color:blue"> method</html>|<html><span style="color:green">string</html>|<html>JSON encode an <span style="color:green">array<span style="color:black"> into a <span style="color:green">string<span style="color:black">, with optional <span style="color:blue">method</html>|
 |[[.functions:ln]]|<html><span style="color:green">number<span style="color:blue"> number</html>|<html><span style="color:green">float<span style="color:black"> log<sub>e</sub></html>|Return the natural logarithm of a <html><span style="color:blue">number</html>| |[[.functions:ln]]|<html><span style="color:green">number<span style="color:blue"> number</html>|<html><span style="color:green">float<span style="color:black"> log<sub>e</sub></html>|Return the natural logarithm of a <html><span style="color:blue">number</html>|
Line 142: Line 153:
 |[[.functions:ow_reset]]|||Reset the OneWire bus| |[[.functions:ow_reset]]|||Reset the OneWire bus|
 |[[.functions:ow_write]]|<html><span style="color:green">int<span style="color:blue"> value</html>||Write a byte to the OneWire bus| |[[.functions:ow_write]]|<html><span style="color:green">int<span style="color:blue"> value</html>||Write a byte to the OneWire bus|
-|[[.functions:pack]]|<html><span style="color:green">string<span style="color:blue"> format<span style="color:black">, <span style="color:green">mixed <span style="color:blue"> value<span style="color:black"></html> |<html><span style="color:green">string</html>|Pack a value into a <html><span style="color:green">string<span style="color:black"></html>|+|[[.functions:pack]]|<html><span style="color:green">string<span style="color:blue"> format<span style="color:black">, <span style="color:green">mixed <span style="color:blue"> value<span style="color:black"></html> |<html><span style="color:green">string</html>|<html>Pack a value into a <html><span style="color:green">string<span style="color:black"></html>|
 |[[.functions:phpinfo]]||<html><span style="color:green">string</html>|Return information about the system| |[[.functions:phpinfo]]||<html><span style="color:green">string</html>|Return information about the system|
 |[[.functions:pin_configure]]|<html><span style="color:green">int<span style="color:blue"> pin_index<span style="color:black">,<span style="color:green"> int<span style="color:blue"> pin_type<span style="color:black">,<span style="color:green"> int<span style="color:blue"> counter_type</html>||Configure an <tooltip title="Input/Output">I/O</tooltip> pin as a digital input, output, or analog input| |[[.functions:pin_configure]]|<html><span style="color:green">int<span style="color:blue"> pin_index<span style="color:black">,<span style="color:green"> int<span style="color:blue"> pin_type<span style="color:black">,<span style="color:green"> int<span style="color:blue"> counter_type</html>||Configure an <tooltip title="Input/Output">I/O</tooltip> pin as a digital input, output, or analog input|
Line 157: Line 168:
 |[[.functions:reboot]]|||Reboot the processor| |[[.functions:reboot]]|||Reboot the processor|
 |[[.functions:register_callback]]|<html><span style="color:green">string<span style="color:blue"> callback_type<span style="color:black">, <span style="color:green">string<span style="color:blue"> filename, <span style="color:green">string<span style="color:blue"> functionname</html>|<html><span style="color:green">int<span style="color:black"> 0 or error code</html>|<html>Register a callback function for system events </html>| |[[.functions:register_callback]]|<html><span style="color:green">string<span style="color:blue"> callback_type<span style="color:black">, <span style="color:green">string<span style="color:blue"> filename, <span style="color:green">string<span style="color:blue"> functionname</html>|<html><span style="color:green">int<span style="color:black"> 0 or error code</html>|<html>Register a callback function for system events </html>|
- 
 |[[.functions:rename]]|<html><span style="color:green">string<span style="color:blue"> source<span style="color:black">, <span style="color:green">string<span style="color:blue"> destination</html>|<html><span style="color:green">int<span style="color:black"> 0 or error code</html>|<html>Rename or move a file or directory from <span style="color:blue">source<span style="color:black"> to <span style="color:blue">destination</html>| |[[.functions:rename]]|<html><span style="color:green">string<span style="color:blue"> source<span style="color:black">, <span style="color:green">string<span style="color:blue"> destination</html>|<html><span style="color:green">int<span style="color:black"> 0 or error code</html>|<html>Rename or move a file or directory from <span style="color:blue">source<span style="color:black"> to <span style="color:blue">destination</html>|
 |[[.functions:reset]]|||Reset the processor| |[[.functions:reset]]|||Reset the processor|
Line 165: Line 175:
 |[[.functions:session_is_new]]||<html><span style="color:green">int</html>|Check if a session was just initiated| |[[.functions:session_is_new]]||<html><span style="color:green">int</html>|Check if a session was just initiated|
 |[[.functions:session_start]]|||Initiate a new session and send the cookie data for it| |[[.functions:session_start]]|||Initiate a new session and send the cookie data for it|
 +|[[.functions:set_cert_key]]|<html><span style="color:green">string<span style="color:blue"> key</html>,<html><span style="color:green">string<span style="color:blue"> cert</html>||Set a custom certificate encryption key|
 |[[.functions:set_search_path]]|<html><span style="color:green">string<span style="color:blue"> pathname</html>||Set the search path for the telnet client| |[[.functions:set_search_path]]|<html><span style="color:green">string<span style="color:blue"> pathname</html>||Set the search path for the telnet client|
 |[[.functions:setethpower]]|<html><span style="color:green">int<span style="color:blue"> state</html>||Enable or disable the ethernet controller| |[[.functions:setethpower]]|<html><span style="color:green">int<span style="color:blue"> state</html>||Enable or disable the ethernet controller|
Line 174: Line 185:
 |[[.functions:sizeof]]|<html><span style="color:green">array</html>|<html><span style="color:green">int<span style="color:black"> number of elements</html>|<html>Return the number of elements in an <span style="color:green">array</html>| |[[.functions:sizeof]]|<html><span style="color:green">array</html>|<html><span style="color:green">int<span style="color:black"> number of elements</html>|<html>Return the number of elements in an <span style="color:green">array</html>|
 |[[.functions:sleep]]|<html><span style="color:green">int<span style="color:blue"> ms</html>||Sleep for specified milliseconds| |[[.functions:sleep]]|<html><span style="color:green">int<span style="color:blue"> ms</html>||Sleep for specified milliseconds|
 +|[[.functions:snmp_trap_send]]|<html><span style="color:green">string<span style="color:blue"> message<span style="color:black"></html>|<html><span style="color:green">int<span style="color:black"> 0 or 1</html>|<html>Send an SNMP trap message with ASCII content of <span style="color:blue">source</html>|
 |[[.functions:spi_clearcs]]|||Clear the CS output of the <tooltip title="Serial Peripheral Interface">SPI</tooltip> bus| |[[.functions:spi_clearcs]]|||Clear the CS output of the <tooltip title="Serial Peripheral Interface">SPI</tooltip> bus|
 |[[.functions:spi_read]]||<html><span style="color:green">int<span style="color:black"> byte</html>|Read a byte from the <tooltip title="Serial Peripheral Interface">SPI</tooltip> bus| |[[.functions:spi_read]]||<html><span style="color:green">int<span style="color:black"> byte</html>|Read a byte from the <tooltip title="Serial Peripheral Interface">SPI</tooltip> bus|
Line 182: Line 194:
 |[[.functions:sqrt]]|<html><span style="color:green">number<span style="color:blue"> number</html>|<html><span style="color:green">number<span style="color:black"> square root</html>|Return the square root of a <html><span style="color:blue">number</html>| |[[.functions:sqrt]]|<html><span style="color:green">number<span style="color:blue"> number</html>|<html><span style="color:green">number<span style="color:black"> square root</html>|Return the square root of a <html><span style="color:blue">number</html>|
 |[[.functions:stats]]||<html><span style="color:green">array</html>|Return system statistics| |[[.functions:stats]]||<html><span style="color:green">array</html>|Return system statistics|
 +|[[.functions:str_replace]]|<html><span style="color:green">string<span style="color:blue"> search<span style="color:black">, <span style="color:green">string<span style="color:blue"> replace, <span style="color:green">string<span style="color:blue"> subject,[<span style="color:green">int<span style="color:blue"> &count]</html>|<html><span style="color:green">string<span style="color:black"> result</html>|<html>Return the string with each occurrence of <span style="color:blue">search<span style="color:black"> replaced with <span style="color:blue">replace<span style="color:black"></html>|
 |[[.functions:strftime]]|<html><span style="color:green">string<span style="color:blue"> format<span style="color:black">,<span style="color:green"> int<span style="color:blue"> timestamp</html>|<html><span style="color:green">string<span style="color:black"> formatted</html>|<html>Format a Linux <span style="color:blue">Timestamp<span style="color:black"> using a <span style="color:blue">format <span style="color:green">string</html>| |[[.functions:strftime]]|<html><span style="color:green">string<span style="color:blue"> format<span style="color:black">,<span style="color:green"> int<span style="color:blue"> timestamp</html>|<html><span style="color:green">string<span style="color:black"> formatted</html>|<html>Format a Linux <span style="color:blue">Timestamp<span style="color:black"> using a <span style="color:blue">format <span style="color:green">string</html>|
 |[[.functions:strlen]]|<html><span style="color:green">string<span style="color:blue"> input</html>|<html><span style="color:green">int<span style="color:black"> length</html>|Return the length of a <html><span style="color:green">string</html>| |[[.functions:strlen]]|<html><span style="color:green">string<span style="color:blue"> input</html>|<html><span style="color:green">int<span style="color:black"> length</html>|Return the length of a <html><span style="color:green">string</html>|
Line 198: Line 211:
 |[[.functions:unlink]]|<html><span style="color:green">string <span style="color:blue">filename</html>|<html><span style="color:green">int<span style="color:black"> 0 or error code</html>|Remove a file (delete it)| |[[.functions:unlink]]|<html><span style="color:green">string <span style="color:blue">filename</html>|<html><span style="color:green">int<span style="color:black"> 0 or error code</html>|Remove a file (delete it)|
 |[[.functions:untar]]|<html><span style="color:green">string<span style="color:blue"> filename<span style="color:black">,<span style="color:green"> int<span style="color:blue"> verbosity</html>|<html><span style="color:green">int<span style="color:black"> 1=OK</html>|Expand a TAR file into the current folder, optionally verbose| |[[.functions:untar]]|<html><span style="color:green">string<span style="color:blue"> filename<span style="color:black">,<span style="color:green"> int<span style="color:blue"> verbosity</html>|<html><span style="color:green">int<span style="color:black"> 1=OK</html>|Expand a TAR file into the current folder, optionally verbose|
-|[[.functions:unpack]]|<html><span style="color:green">string<span style="color:blue"> format<span style="color:black">, <span style="color:green">string <span style="color:blue"> value<span style="color:black"></html> |<html><span style="color:green">number</html>|Unpack a packed string value and return the original data<span style="color:black"></html>|+|[[.functions:unpack]]|<html><span style="color:green">string<span style="color:blue"> format<span style="color:black">, <span style="color:green">string <span style="color:blue"> value<span style="color:black"></html> |<html><span style="color:green">number</html>|<html>Unpack a packed string value and return the original data<span style="color:black"></html>|
 |[[.functions:uptime]]||<html><span style="color:green">int<span style="color:black"> ms</html>|Return the uptime in milliseconds| |[[.functions:uptime]]||<html><span style="color:green">int<span style="color:black"> ms</html>|Return the uptime in milliseconds|
 +|[[.functions:urldecode]]|<html><span style="color:green">string <span style="color:blue">str</html>|<html><span style="color:green">string<span style="color:black"> string to encode</html>|URL-Decode a string|
 +|[[.functions:urlencode]]|<html><span style="color:green">string <span style="color:blue">str</html>|<html><span style="color:green">string<span style="color:black"> encoded string</html>|URL-Encode a string|
 |[[.functions:wifi_disable]]|||Disable Wifi module| |[[.functions:wifi_disable]]|||Disable Wifi module|
 |[[.functions:wifi_enable]]|||Enable Wifi module| |[[.functions:wifi_enable]]|||Enable Wifi module|
  
uphp/functions.txt · Last modified: 2022/09/23 04:53 by admin