function _opigno_scorm_format_string_length in Opigno SCORM 3.x
Same name and namespace in other branches
- 8 opigno_scorm.module \_opigno_scorm_format_string_length()
Truncates string by wanted length if necessary.
Parameters
string $string: String to format.
int $length: Necessary string length.
Return value
string Formatted string.
1 call to _opigno_scorm_format_string_length()
- _opigno_scorm_save_interaction in ./
opigno_scorm.module - Recursive save of xAPI data.
File
- ./
opigno_scorm.module, line 413 - Module functionality implementation.
Code
function _opigno_scorm_format_string_length($string, $length) {
if (strlen($string) > $length) {
return substr($string, 0, $length);
}
return $string;
}