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
uphp:functions [2021/11/12 11:04]
admin
uphp:functions [2022/09/23 04:53] (current)
admin
Line 42: Line 42:
 |[[.functions:fgets]]|<html><span style="color:green">int<span style="color:blue"> handle<span style="color:black">,<span style="color:green"> int<span style="color:blue"> size</html>|<html><span style="color:green">string<span style="color:black"> or <span style="color:green">int<span style="color:black"> -1</html>|<html>Return a single line from a file, stream or socket, with optional <span style="color:blue">size<span style="color:black"> limit</html>| |[[.functions:fgets]]|<html><span style="color:green">int<span style="color:blue"> handle<span style="color:black">,<span style="color:green"> int<span style="color:blue"> size</html>|<html><span style="color:green">string<span style="color:black"> or <span style="color:green">int<span style="color:black"> -1</html>|<html>Return a single line from a file, stream or socket, with optional <span style="color:blue">size<span style="color:black"> limit</html>|
 |[[.functions:file_exists]]|<html><span style="color:green">string<span style="color:blue"> filename</html>|<html><span style="color:green">int<span style="color:black"> 1 or 0</html>|Check if a file exists| |[[.functions:file_exists]]|<html><span style="color:green">string<span style="color:blue"> filename</html>|<html><span style="color:green">int<span style="color:black"> 1 or 0</html>|Check if a file exists|
 +|[[.functions:filemtime]]|<html><span style="color:green">string<span style="color:blue"> filename</html>|<html><span style="color:green">int<span style="color:black"> bytes</html>|Return the last modified timestamp for a file|
 |[[.functions:filesize]]|<html><span style="color:green">string<span style="color:blue"> filename<span style="color:black"> or<span style="color:green"> int<span style="color:blue"> handle</html>|<html><span style="color:green">int<span style="color:black"> bytes</html>|Return the size of a file, or the number of unread bytes in a stream or socket| |[[.functions:filesize]]|<html><span style="color:green">string<span style="color:blue"> filename<span style="color:black"> or<span style="color:green"> int<span style="color:blue"> handle</html>|<html><span style="color:green">int<span style="color:black"> bytes</html>|Return the size of a file, or the number of unread bytes in a stream or socket|
 |[[.functions:findfirst]]|<html><span style="color:green">string<span style="color:blue"> pattern<span style="color:black">,<span style="color:green"> int<span style="color:blue"> attributes</html>|<html><span style="color:green">array<span style="color:black"> first file found</html>|<html>Start searching the current folder for files matching a <span style="color:blue">pattern<span style="color:black"> and <span style="color:blue">attributes</html>| |[[.functions:findfirst]]|<html><span style="color:green">string<span style="color:blue"> pattern<span style="color:black">,<span style="color:green"> int<span style="color:blue"> attributes</html>|<html><span style="color:green">array<span style="color:black"> first file found</html>|<html>Start searching the current folder for files matching a <span style="color:blue">pattern<span style="color:black"> and <span style="color:blue">attributes</html>|
Line 51: Line 52:
 |[[.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: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 100: Line 100:
 |[[.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 168: Line 169:
 |[[.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|
uphp/functions.1636715074.txt.gz · Last modified: 2021/11/12 11:04 by admin