CI_Form_validation::has_rule()

has_rule($field) Parameters: $field (string) – Field name Returns: TRUE if the field has rules set, FALSE if not Return type: bool Checks to see if there is a rule set for the specified field.

CI_FTP::upload()

upload($locpath, $rempath[, $mode = 'auto'[, $permissions = NULL]]) Parameters: $locpath (string) – Local file path $rempath (string) – Remote file path $mode (string) – FTP mode, defaults to ‘auto’ (options are: ‘auto’, ‘binary’, ‘ascii’) $permissions (int) – File permissions (octal) Returns: TRUE on success, FALSE on failure Return type: bool Uploads a file to your server. You must supply the local path and the remote path, and you can optionally set the mode and permissions. E

function_usable()

function_usable($function_name) Parameters: $function_name (string) – Function name Returns: TRUE if the function can be used, FALSE if not Return type: bool Returns TRUE if a function exists and is usable, FALSE otherwise. This function runs a function_exists() check and if the Suhosin extension <http://www.hardened-php.net/suhosin/> is loaded, checks if it doesn’t disable the function being checked. It is useful if you want to check for the availability of functions such as

CI_Security::sanitize_filename()

sanitize_filename($str[, $relative_path = FALSE]) Parameters: $str (string) – File name/path $relative_path (bool) – Whether to preserve any directories in the file path Returns: Sanitized file name/path Return type: string Tries to sanitize filenames in order to prevent directory traversal attempts and other security threats, which is particularly useful for files that were supplied via user input. $filename = $this->security->sanitize_filename($this->input->post('file

CI_Output::_display()

_display([$output = '']) Parameters: $output (string) – Output data override Returns: void Return type: void Sends finalized output data to the browser along with any server headers. It also stops benchmark timers. Note This method is called automatically at the end of script execution, you won’t need to call it manually unless you are aborting script execution using exit() or die() in your code. Example: $response = array('status' => 'OK'); $this->output ->set_s

remove_invisible_characters()

remove_invisible_characters($str[, $url_encoded = TRUE]) Parameters: $str (string) – Input string $url_encoded (bool) – Whether to remove URL-encoded characters as well Returns: Sanitized string Return type: string This function prevents inserting NULL characters between ASCII characters, like Java\0script. Example: remove_invisible_characters('Java\\0script'); // Returns: 'Javascript'

CI_Input::get_post()

get_post($index[, $xss_clean = NULL]) Parameters: $index (string) – GET/POST parameter name $xss_clean (bool) – Whether to apply XSS filtering Returns: GET/POST value if found, NULL if not Return type: mixed This method works the same way as post_get() only it looks for GET data first. $this->input->get_post(‘some_data’, TRUE); Note This method used to act EXACTLY like post_get(), but it’s behavior has changed in CodeIgniter 3.0.

humanize()

humanize($str[, $separator = '_']) Parameters: $str (string) – Input string $separator (string) – Input separator Returns: Humanized string Return type: string Takes multiple words separated by underscores and adds spaces between them. Each word is capitalized. Example: echo humanize('my_dog_spot'); // Prints 'My Dog Spot' To use dashes instead of underscores: echo humanize('my-dog-spot', '-'); // Prints 'My Dog Spot'

word_wrap()

word_wrap($str[, $charlim = 76]) Parameters: $str (string) – Input string $charlim (int) – Character limit Returns: Word-wrapped string Return type: string Wraps text at the specified character count while maintaining complete words. Example: $string = "Here is a simple string of text that will help us demonstrate this function."; echo word_wrap($string, 25); // Would produce: // Here is a simple string // of text that will help us // demonstrate this // function.

url_title()

url_title($str, $separator = '-', $lowercase = FALSE) Parameters: $str (string) – Input string $separator (string) – Word separator $lowercase (bool) – Whether to transform the output string to lower-case Returns: URL-formatted string Return type: string Takes a string as input and creates a human-friendly URL string. This is useful if, for example, you have a blog in which you’d like to use the title of your entries in the URL. Example: $title = "What's wrong with CSS?"; $url_tit