Chris@0: string = $string; Chris@0: return $safe_string; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Returns the string version of the Markup object. Chris@0: * Chris@0: * @return string Chris@0: * The safe string content. Chris@0: */ Chris@0: public function __toString() { Chris@0: return $this->string; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Returns the string length. Chris@0: * Chris@0: * @return int Chris@0: * The length of the string. Chris@0: */ Chris@0: public function count() { Chris@17: return mb_strlen($this->string); Chris@0: } Chris@0: Chris@0: /** Chris@0: * Returns a representation of the object for use in JSON serialization. Chris@0: * Chris@0: * @return string Chris@0: * The safe string content. Chris@0: */ Chris@0: public function jsonSerialize() { Chris@0: return $this->__toString(); Chris@0: } Chris@0: Chris@0: }