protected function prepareText(&$text) {

        // check if it is a string
        if (!is_string($text)) {

            // it is not, raise a flag
            return false;
        }

        // trim any front or ending spaces
        $text = trim($text);

        // if there is no text, no need to continue
        if (strlen($text) == 0) {

            // there is not text, raise a flag
            return false;
        }

        return true;
    }
protected function prepareText(&$text) {

        // check if it is a string
        if (!is_string($text)) {

            // it is not, raise a flag
            return false;
        }

        // trim any front or ending spaces
        $text = trim($text);

        // if there is no text, no need to continue
        if (strlen($text) == 0) {

            // there is not text, raise a flag
            return false;
        }

        return true;
    }
protected function prepareText ( & $ text ) { // check if it is a string if ( ! is_string ( $ text ) ) { // it is not, raise a flag return false ; } // trim any front or ending spaces $ text = trim ( $ text ) ; // if there is no text, no need to continue if ( strlen ( $ text ) == 0 ) { // there is not text, raise a flag return false ; } return true ; }
Prepare the text, if the text has no length, return false to indicate something went wrong
@param $text
@return bool
Prepare the text if the text has no length return false to indicate something went wrong