You are here

public static function AcquiaLiftAPI::cleanFeatureString in Acquia Lift Connector 7

Returns a "clean" version of the passed in string.

Parameters

$str: The string to be cleaned.

Return value

string The clean string.

1 call to AcquiaLiftAPI::cleanFeatureString()
AcquiaLiftAgent::convertContextToFeatureString in plugins/agent_types/AcquiaLiftAgent.inc
Implements PersonalizeAgentInterface::convertContextToFeatureString().

File

includes/acquia_lift.classes.inc, line 264
Provides an agent type for Acquia Lift

Class

AcquiaLiftAPI
@file Provides an agent type for Acquia Lift

Code

public static function cleanFeatureString($str) {
  $string = preg_replace('/' . self::FEATURE_STRING_REPLACE_PATTERN . '/', '-', $str);

  // Get rid of instances of multiple '-' characters after replacement.
  $string = preg_replace('/\\-{2,}/', '-', $string);
  return $string;
}