PHP Functions
PHP Functions are a feature that allows developers to split complex logic into smaller parts, and perform the whole task in one call. This makes the code reusable and simpler to understand.
The oci_field_name function returns the name of the field in the current row returned by the oci_fetch() function. The function supports both associative and numeric arrays, and it also handles NULL values. The function also escapes any text that resembles HTML tags, making it more suitable for Web use.
The function is executed after the statement has been parsed, but before it has been fetched by oci_fetch(). This is commonly used for INSERT statements where data is bound with oci_bind_by_name. After execution, the data is committed to the database. This is done automatically by default, but you can override this with the oci_commit() and oci_rollback() functions.
In PHP, a function name may be any string that ends with open and closed parenthesis. The function’s arguments are specified within the parentheses, and may contain any number of variables. Using PHP Functions can save a lot of time and effort, since the application logic can be split into several small pieces and performed in different calls to the function.
The oci_fetch_array() function retrieves the results of a query, and can be passed an optional mode parameter. The mode parameter specifies the behavior of the function: Associative array – return all rows in an associative array, numeric array – return all columns in the current row as a numeric array, or both.