Troubleshooting

If you find that no matter what you put in your URL only your default page is loading, it might be that your server does not support the REQUEST_URI variable needed to serve search-engine friendly URLs. As a first step, open your application/config/config.php file and look for the URI Protocol information. It will recommend that you try a couple alternate settings. If it still doesn’t work after you’ve tried this you’ll need to force CodeIgniter to add a question mark to your URLs. To do this o

trim_slashes()

trim_slashes($str) Parameters: $str (string) – Input string Returns: Slash-trimmed string Return type: string Removes any leading/trailing slashes from a string. Example: $string = "/this/that/theother/"; echo trim_slashes($string); // results in this/that/theother Note This function is DEPRECATED. Use the native trim() instead: | | trim($str, ‘/’);

Transactions

CodeIgniter’s database abstraction allows you to use transactions with databases that support transaction-safe table types. In MySQL, you’ll need to be running InnoDB or BDB table types rather than the more common MyISAM. Most other database platforms support transactions natively. If you are not familiar with transactions we recommend you find a good online resource to learn about them for your particular database. The information below assumes you have a basic understanding of transactions. C

timezone_menu()

timezone_menu([$default = 'UTC'[, $class = ''[, $name = 'timezones'[, $attributes = '']]]]) Parameters: $default (string) – Timezone $class (string) – Class name $name (string) – Menu name $attributes (mixed) – HTML attributes Returns: HTML drop down menu with time zones Return type: string Generates a pull-down menu of timezones, like this one: (UTC -12:00) Baker/Howland Island(UTC -11:00) Samoa Time Zone, Niue(UTC -10:00) Hawaii-Aleutian Standard Time, Cook Islands, Tahiti(UT

timezones()

timezones([$tz = '']) Parameters: $tz (string) – A numeric timezone Returns: Hour difference from UTC Return type: int Takes a timezone reference (for a list of valid timezones, see the “Timezone Reference” below) and returns the number of hours offset from UTC. Example: echo timezones('UM5'); This function is useful when used with timezone_menu().

timespan()

timespan([$seconds = 1[, $time = ''[, $units = '']]]) Parameters: $seconds (int) – Number of seconds $time (string) – UNIX timestamp $units (int) – Number of time units to display Returns: Formatted time difference Return type: string Formats a UNIX timestamp so that is appears similar to this: 1 Year, 10 Months, 2 Weeks, 5 Days, 10 Hours, 16 Minutes The first parameter must contain a UNIX timestamp. The second parameter must contain a timestamp that is greater that the first tim

symbolic_permissions()

symbolic_permissions($perms) Parameters: $perms (int) – Permissions Returns: Symbolic permissions string Return type: string Takes numeric permissions (such as is returned by fileperms()) and returns standard symbolic notation of file permissions. echo symbolic_permissions(fileperms('./index.php')); // -rw-r--r--

strip_slashes()

strip_slashes($data) Parameters: $data (mixed) – Input string or an array of strings Returns: String(s) with stripped slashes Return type: mixed Removes any slashes from an array of strings. Example: $str = array( 'question'  => 'Is your name O\'reilly?', 'answer' => 'No, my name is O\'connor.' ); $str = strip_slashes($str); The above will return the following array: array( 'question'  => "Is your name O'reilly?", 'answer' => "No, my nam

strip_quotes()

strip_quotes($str) Parameters: $str (string) – Input string Returns: String with quotes stripped Return type: string Removes single and double quotes from a string. Example: $string = "Joe's \"dinner\""; $string = strip_quotes($string); //results in "Joes dinner"

strip_image_tags()

strip_image_tags($str) Parameters: $str (string) – Input string Returns: The input string with no image tags Return type: string This is a security function that will strip image tags from a string. It leaves the image URL as plain text. Example: $string = strip_image_tags($string); This function is an alias for CI_Security::strip_image_tags(). For more info, please see the Security Library documentation.