You are here

function features_override_encode_string in Features Override 7.2

Same name and namespace in other branches
  1. 6.2 features_override.export.inc \features_override_encode_string()

Encodes a string for use as option.

Parameters

$string: A string to encode.

Return value

string An encoded string for use as option value.

See also

features_dom_encode_options()

File

./features_override.export.inc, line 465
Helper function to export features overrides.

Code

function features_override_encode_string($string) {
  $replacements = array(
    ':' => '__' . ord(':') . '__',
    '/' => '__' . ord('/') . '__',
    ',' => '__' . ord(',') . '__',
    '.' => '__' . ord('.') . '__',
    '<' => '__' . ord('<') . '__',
    '>' => '__' . ord('>') . '__',
  );
  return strtr($string, $replacements);
}