Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

truncate_join_field_value()

Description

Truncate the field for insertion into the main resource table field

Parameters

ColumnTypeDefaultDescription
$value string

Return

string

Location

include/resource_functions.php lines 5795 to 5820

Definition

 
function truncate_join_field_value($value)
    {
    global 
$resource_field_column_limit$server_charset;

    
$encoding 'UTF-8';

    if(isset(
$server_charset) && '' != $server_charset)
        {
        
$encoding $server_charset;
        }

    
$truncated_value mb_substr($value0$resource_field_column_limit$encoding);

    if(
$resource_field_column_limit >= strlen($truncated_value))
        {
        return 
$truncated_value;
        }

    
$more_limit $resource_field_column_limit;
    while(
$resource_field_column_limit strlen($truncated_value))
        {
        
$truncated_value mb_substr($value0, --$more_limit$encoding);
        }

    return 
$truncated_value;
    }

This article was last updated 12th July 2020 08:05 Europe/London time based on the source file dated 10th July 2020 16:06 Europe/London time.