APIBoost A.P.I. documentation for PHPBoost CMS
  • Packages
    • Ajax
    • Builder
    • Content
    • Core
    • Default
    • Doctrine
    • Helper
    • IO
    • MVC
    • PHPBoost
    • Util
  • Interfaces
  • Classes
  • CacheData
  • CaptchaOptions
  • CommentsExtensionPoint
  • ConfigData
  • ContentFormattingExtensionPoint
  • Controller
  • CssFilesExtensionPoint
  • DAO
  • DataStore
  • DBConnection
  • DBMSFactory
  • DBMSUtils
  • ExtendedFieldExtensionPoint
  • ExtensionPoint
  • ExternalAuthentication
  • FeedProvider
  • FileReader
  • FileWriter
  • FormattingParser
  • FormButton
  • FormConstraint
  • FormElement
  • FormField
  • FormFieldConstraint
  • FormFieldEnumOption
  • FormFieldset
  • GraphicalEnvironment
  • HomePage
  • HomePageExtensionPoint
  • HTMLElement
  • HTMLTableFilter
  • InjectQueryResult
  • MailService
  • MemberExtendedFieldType
  • MenusExtensionPoint
  • ModuleSetup
  • ModuleTreeLinksExtensionPoint
  • PropertiesMapInterface
  • QueryResult
  • Response
  • ScheduledJobExtensionPoint
  • SearchableExtensionPoint
  • SelectQueryResult
  • SQLFragmentBuilder
  • SQLQuerier
  • SQLQueryTranslator
  • Template
  • TemplateData
  • TemplateLoader
  • TemplateParser
  • TemplateRenderer
  • TemplateSyntaxElement
  • UrlMapper
  • UrlMappingsExtensionPoint
  • View
  • AbstractAdminItemController
  • AbstractCategoriesFormController
  • AbstractCategoriesManagementController
  • AbstractCommentsBuildForm
  • AbstractCommentsController
  • AbstractConfigData
  • AbstractContentFormattingExtensionPoint
  • AbstractController
  • AbstractDeleteCategoryController
  • AbstractDisplayGraphicalEnvironment
  • AbstractFormButton
  • AbstractFormField
  • AbstractFormFieldChoice
  • AbstractFormFieldConstraint
  • AbstractFormFieldEnumOption
  • AbstractFormFieldset
  • AbstractGraphicalEnvironment
  • AbstractHTMLElement
  • AbstractHTMLTableFilter
  • AbstractItemController
  • AbstractMemberExtendedField
  • AbstractParser
  • AbstractPHPMailerMailService
  • AbstractPlatform
  • AbstractQueryResult
  • AbstractResponse
  • AbstractScheduledJobExtensionPoint
  • AbstractSearchableExtensionPoint
  • AbstractSelectQueryResult
  • AbstractSQLQuerier
  • AbstractTemplate
  • AbstractTemplateParser
  • AbstractTemplateSyntaxElement
  • AbstractUrlMapper
  • ActionAuthorization
  • AddCommentBuildForm
  • AdminController
  • AdminDisplayFrameGraphicalEnvironment
  • AdminDisplayFrameResponse
  • AdminDisplayGraphicalEnvironment
  • AdminDisplayResponse
  • AdministratorAlert
  • AdministratorAlertCache
  • AdministratorAlertService
  • AdminMenuDisplayResponse
  • AdminModuleController
  • AdminModuleLink
  • AdminNodisplayGraphicalEnvironment
  • AdminNodisplayResponse
  • AjaxCommentsDisplayController
  • AjaxCommentsNotationController
  • AjaxImagePreviewController
  • AjaxKeywordsAutoCompleteController
  • AjaxRequest
  • AjaxSearchUserAutoCompleteController
  • AjaxUrlValidationController
  • AjaxUserAutoCompleteController
  • APCDataStore
  • AppContext
  • Application
  • ArrayContentTemplateSyntaxElement
  • Arrays
  • ArrayTemplateSyntaxElement
  • ArrayType
  • ATOM
  • AuthenticationMethod
  • AuthenticationService
  • Authorizations
  • AuthorizationsSettings
  • AutoConnectData
  • BBCodeHighlighter
  • Bench
  • BigIntType
  • BooleanType
  • BreadCrumb
  • BrHTMLElement
  • BufferedFileReader
  • BufferedFileWriter
  • BusinessObject
  • CacheDataNotFoundException
  • CachedMenu
  • CachedStringTemplateLoader
  • CacheManager
  • CacheService
  • Captcha
  • CaptchaProvidersService
  • CaptchaService
  • CategoriesAuthorizationsService
  • CategoriesCache
  • CategoriesItemsParameters
  • CategoriesManager
  • CategoriesService
  • CategoriesUrlBuilder
  • Category
  • CategoryNotFoundException
  • ClassLoader
  • ColumnsDisabled
  • CommentsAuthorizations
  • CommentsCache
  • CommentsConfig
  • CommentsDAO
  • CommentsManager
  • CommentsProvidersService
  • CommentsService
  • CommentsTopic
  • CommentsTopicDAO
  • CommentsTopicEvents
  • CommentsTopics
  • CommentsUrlBuilder
  • ConditionTemplateSyntaxElement
  • ConfigManager
  • ConfigNotFoundException
  • ConstantTemplateSyntaxElement
  • ContentEditor
  • ContentFormattingConfig
  • ContentFormattingParser
  • ContentFormattingProvidersService
  • ContentFormattingService
  • ContentFormattingUnparser
  • ContentManagementConfig
  • ContentMenu
  • ContentSecondParser
  • ContentSharingActionsMenuLink
  • ContentSharingActionsMenuLinksExtensionPoint
  • ContentSharingActionsMenuService
  • Contribution
  • ContributionService
  • CookieBarConfig
  • Countries
  • CSSCacheConfig
  • CSSCacheManager
  • CSSFileOptimizer
  • CurrentUser
  • CustomizationConfig
  • CustomizeInterface
  • DataStoreException
  • DataStoreFactory
  • Date
  • DateTimeType
  • DateType
  • DBConnectionException
  • DBFactory
  • DBQuerier
  • Debug
  • DecimalType
  • DefaultAdminDisplayResponse
  • DefaultAjaxDeleteItemController
  • DefaultCategoriesCache
  • DefaultCategoriesFeedProvider
  • DefaultCategoriesFormController
  • DefaultCategoriesManagementController
  • DefaultCommentsTopic
  • DefaultConfigurationController
  • DefaultDeleteCategoryController
  • DefaultDeleteItemController
  • DefaultDisplayItemController
  • DefaultHomePage
  • DefaultHomePageDisplay
  • DefaultItemsManagementController
  • DefaultMailService
  • DefaultModuleConfig
  • DefaultModuleSetup
  • DefaultRichCategoriesCache
  • DefaultRichModuleConfig
  • DefaultScheduledJobsModule
  • DefaultSearchable
  • DefaultSeveralItemsController
  • DefaultSitemapCategoriesModule
  • DefaultSitemapModule
  • DefaultTemplateData
  • DefaultTemplateRenderer
  • DefaultTreeLinks
  • DeleteLinkHTMLElement
  • Dispatcher
  • DispatcherException
  • DispatcherUrlMapping
  • DispatchManager
  • DivHTMLElement
  • DoctrineException
  • EditCommentBuildForm
  • EditLinkHTMLElement
  • Environment
  • ErrorHandler
  • Event
  • ExceptionHandler
  • ExceptionUtils
  • ExpressionContentTemplateSyntaxElement
  • ExpressionTemplateSyntaxElement
  • ExtendedField
  • ExtendedFields
  • ExtendedFieldsCache
  • ExtendedFieldsDatabaseService
  • ExtendedFieldsService
  • ExtensionPointNotFoundException
  • ExtensionPointProvider
  • ExtensionPointProviderService
  • ExternalAuthenticationsExtensionPoint
  • Feed
  • FeedData
  • FeedItem
  • FeedItemEnclosure
  • FeedMenu
  • FeedsCat
  • FeedsCategoriesModule
  • FeedsList
  • File
  • FileSystemDataStore
  • FileSystemElement
  • FileSystemHelper
  • FileTemplate
  • FileTemplateLoader
  • FileTemplateLoadingException
  • FileTemplateRenderingException
  • FileType
  • FileUploadConfig
  • FileUploadService
  • Filter
  • FloatType
  • Folder
  • FormatingHelper
  • FormBuilderDisabledFieldException
  • FormBuilderException
  • FormButtonAjax
  • FormButtonAjaxCssImg
  • FormButtonButton
  • FormButtonButtonCssImg
  • FormButtonDefaultSubmit
  • FormButtonLink
  • FormButtonLinkCssImg
  • FormButtonReset
  • FormButtonSubmit
  • FormButtonSubmitCssImg
  • FormButtonSubmitImg
  • FormConstraintFieldsDifferenceInferior
  • FormConstraintFieldsDifferenceSuperior
  • FormConstraintFieldsEquality
  • FormConstraintFieldsInequality
  • FormConstraintFieldsNotIncluded
  • FormFieldActionLink
  • FormFieldActionLinkElement
  • FormFieldActionLinkList
  • FormFieldAjaxCompleter
  • FormFieldAjaxSearchUserAutoComplete
  • FormFieldAjaxUserAutoComplete
  • FormFieldAuthorizationsSetter
  • FormFieldBooleanInformation
  • FormFieldCaptcha
  • FormFieldCategoriesSelect
  • FormFieldCheckbox
  • FormFieldColorPicker
  • FormFieldConstraintAntiFlood
  • FormFieldConstraintDate
  • FormFieldConstraintDisplayNameExists
  • FormFieldConstraintFileExtension
  • FormFieldConstraintFileMaxSize
  • FormFieldConstraintForbiddenMailDomains
  • FormFieldConstraintIntegerMax
  • FormFieldConstraintIntegerMin
  • FormFieldConstraintIntegerRange
  • FormFieldConstraintLengthMax
  • FormFieldConstraintLengthMin
  • FormFieldConstraintLengthRange
  • FormFieldConstraintMailAddress
  • FormFieldConstraintMailExist
  • FormFieldConstraintMaxLinks
  • FormFieldConstraintNotEmpty
  • FormFieldConstraintPasswordStrength
  • FormFieldConstraintPHPBoostAuthLoginExists
  • FormFieldConstraintPictureFile
  • FormFieldConstraintRegex
  • FormFieldConstraintTel
  • FormFieldConstraintUrl
  • FormFieldConstraintUrlExists
  • FormFieldConstraintUserExist
  • FormFieldCSRFToken
  • FormFieldDate
  • FormFieldDateTime
  • FormFieldDecimalNumberEditor
  • FormFieldEditors
  • FormFieldFilePicker
  • FormFieldFree
  • FormFieldGroups
  • FormFieldHidden
  • FormFieldHTML
  • FormFieldLabel
  • FormFieldLangsSelect
  • FormFieldMailEditor
  • FormFieldMemberCaution
  • FormFieldMemberSanction
  • FormFieldMenuFieldset
  • FormFieldMultiLineTextEditor
  • FormFieldMultipleAutocompleter
  • FormFieldMultipleCheckbox
  • FormFieldMultipleCheckboxOption
  • FormFieldMultipleSelectChoice
  • FormFieldMultipleValuedCheckboxOption
  • FormFieldMultitabsLink
  • FormFieldMultitabsLinkElement
  • FormFieldMultitabsLinkList
  • FormFieldNumberEditor
  • FormFieldPasswordEditor
  • FormFieldPossibleValues
  • FormFieldRadioChoice
  • FormFieldRadioChoiceOption
  • FormFieldRangeEditor
  • FormFieldRanksSelect
  • FormFieldRichTextEditor
  • FormFieldSearch
  • FormFieldSelectChoiceGroupOption
  • FormFieldSelectChoiceOption
  • FormFieldSelectSources
  • FormFieldsetAccordionControls
  • FormFieldsetHidden
  • FormFieldsetHorizontal
  • FormFieldsetHTML
  • FormFieldsetHTMLHeading
  • FormFieldsetMultitabsHTML
  • FormFieldsetSubmit
  • FormFieldsetVertical
  • FormFieldShortMultiLineTextEditor
  • FormFieldSimpleSelectChoice
  • FormFieldSpacer
  • FormFieldSubTitle
  • FormFieldTelEditor
  • FormFieldTextEditor
  • FormFieldThemesSelect
  • FormFieldThumbnail
  • FormFieldTimezone
  • FormFieldUploadFile
  • FormFieldUploadPictureFile
  • FormFieldUrlEditor
  • FunctionCallTemplateSyntaxElement
  • FunctionTemplateSyntaxElement
  • GeneralConfig
  • GraphicalEnvironmentConfig
  • GroupsCache
  • GroupsService
  • HtaccessFileCache
  • HTMLForm
  • HTMLTable
  • HTMLTableAjaxUserAutoCompleteFilter
  • HTMLTableAjaxUserAutoCompleteSQLFilter
  • HTMLTableBeginsWithTextSQLFilter
  • HTMLTableCheckboxFilter
  • HTMLTableColumn
  • HTMLTableDateComparatorSQLFilter
  • HTMLTableDateGreaterThanOrEqualsToSQLFilter
  • HTMLTableDateLessThanOrEqualsToSQLFilter
  • HTMLTableDateTimeGreaterThanOrEqualsToSQLFilter
  • HTMLTableDateTimeLessThanOrEqualsToSQLFilter
  • HTMLTableEndsWithTextSQLFilter
  • HTMLTableEqualsFromListFilter
  • HTMLTableEqualsFromListSQLFilter
  • HTMLTableEqualsToSQLFilter
  • HTMLTableEscapedLikeTextSQLFilter
  • HTMLTableGreaterThanOrEqualsToSQLFilter
  • HTMLTableGreaterThanSQLFilter
  • HTMLTableLessThanOrEqualsToSQLFilter
  • HTMLTableLessThanSQLFilter
  • HTMLTableLikeFromListSQLFilter
  • HTMLTableLikeTextSQLFilter
  • HTMLTableModel
  • HTMLTableNumberComparatorSQLFilter
  • HTMLTableParameters
  • HTMLTableRow
  • HTMLTableRowCell
  • HTMLTableSortingRule
  • HTMLTableTextFilter
  • HTMLTableUnapprovedSQLFilter
  • HTTPCookie
  • HTTPFatalExceptionPrinter
  • HTTPRequestCustom
  • HTTPResponseCustom
  • I18NMessages
  • IdcardService
  • IllegalArgumentException
  • Image
  • ImageResizer
  • ImgHTMLElement
  • IncludeTemplateSyntaxElement
  • IntegerType
  • IntegratedErrorHandler
  • InvalidTemplateFunctionCallException
  • IOException
  • Item
  • ItemsAuthorizationsService
  • ItemsManager
  • ItemsModuleExtensionPointProvider
  • ItemsService
  • ItemsUrlBuilder
  • JoinMappingModel
  • JSONResponse
  • KeyGenerator
  • Keyword
  • KeywordsCache
  • KeywordsManager
  • KeywordsService
  • Lang
  • LangConfiguration
  • LangConfigurationManager
  • LangLoader
  • LangNotFoundException
  • LangsConfig
  • LangsManager
  • LangVarTemplateSyntaxElement
  • LastUseDateConfig
  • LinkHTMLElement
  • LinksMenu
  • LinksMenuElement
  • LinksMenuLink
  • LoopTemplateSyntaxElement
  • LoopVarTemplateSyntaxElement
  • Mail
  • MailServiceConfig
  • MailToPHPMailerConverter
  • MailUtil
  • MaintenanceConfig
  • MalformedUrlMapperRegexException
  • MappingModel
  • MappingModelField
  • MemberDateExtendedField
  • MemberDisabledActionAuthorization
  • MemberExtendedField
  • MemberExtendedFieldErrorsMessageException
  • MemberExtendedFieldsService
  • MemberHalfLongTextExtendedField
  • MemberHiddenExtendedField
  • MemberLongTextExtendedField
  • MemberMultipleChoiceExtendedField
  • MemberMultipleSelectExtendedField
  • MemberSanctionManager
  • MemberShortTextExtendedField
  • MemberSimpleChoiceExtendedField
  • MemberSimpleSelectExtendedField
  • MemberUserAvatarExtendedField
  • MemberUserBornExtendedField
  • MemberUserPMToMailExtendedField
  • MemberUserSexExtendedField
  • Menu
  • MenusCache
  • MenuService
  • MenusProvidersService
  • MenuStringFilter
  • MessageHelper
  • MiniCalendar
  • Module
  • ModuleConfiguration
  • ModuleConfigurationManager
  • ModuleController
  • ModuleCssFiles
  • ModuleDispatchManager
  • ModuleExtensionPointProvider
  • ModuleLink
  • ModuleMenus
  • ModuleMiniMenu
  • ModulePagination
  • ModulesConfig
  • ModulesCssFilesService
  • ModulesManager
  • ModulesUrlBuilder
  • ModuleTreeLinks
  • ModuleTreeLinksService
  • MySQLDBConnection
  • MySQLDBConnectionException
  • MySQLDBFactory
  • MySQLDBMSUtils
  • MySQLInjectQueryResult
  • MySqlPlatform
  • MySQLQuerier
  • MySQLQuerierException
  • MySQLQueryTranslator
  • MySQLSelectQueryResult
  • MySQLUnexistingDatabaseException
  • NginxFileCache
  • NoSuchControllerException
  • NotASingleRowFoundException
  • Notation
  • NotationService
  • Notification
  • NotYetImplementedException
  • NoUrlMatchException
  • NumberHelper
  • ObjectNotFoundException
  • ObjectType
  • Pagination
  • ParametersTemplateSyntaxElement
  • ParameterTypeMismatchException
  • Path
  • PDODBConnection
  • PDODBConnectionException
  • PDOInjectQueryResult
  • PDOMySQLDBFactory
  • PDOQuerier
  • PDOQuerierException
  • PDOSelectQueryResult
  • PersistenceContext
  • PHPBoostAuthenticationMethod
  • PHPBoostErrors
  • PHPBoostFoldersPermissions
  • PHPBoostIndexController
  • PHPBoostNotInstalledException
  • PHPTemplateSyntaxElement
  • PlainCodeHighlighter
  • PostgreSqlPlatform
  • PrivateMsg
  • PropertyNotFoundException
  • RAMDataStore
  • RawExceptionHandler
  • RegexHelper
  • RemainingStringVarException
  • Repository
  • RichCategory
  • RichItem
  • RichRootCategory
  • Robots
  • RolesAuthorizations
  • RootCategory
  • RowNotFoundException
  • RSS
  • SearchCategoryChildrensOptions
  • SearchResult
  • SecurityConfig
  • SelectQueryResultMapper
  • SEOMetaData
  • ServerConfiguration
  • ServerEnvironmentConfig
  • Session
  • SessionData
  • SessionNotFoundException
  • SessionsConfig
  • SimpleVarTemplateSyntaxElement
  • SiteDisplayFrameGraphicalEnvironment
  • SiteDisplayFrameResponse
  • SiteDisplayGraphicalEnvironment
  • SiteDisplayResponse
  • SitemapCategoriesModule
  • SiteNodisplayGraphicalEnvironment
  • SiteNodisplayResponse
  • SmallIntType
  • SmileysCache
  • SMTPConfiguration
  • SMTPMailService
  • SpanHTMLElement
  • SQLDAO
  • SQLFragment
  • SQLHTMLTableModel
  • SqlitePlatform
  • SQLQuerierException
  • SQLQueryVars
  • StatsCache
  • StringInputStream
  • StringOutputStream
  • StringTemplate
  • StringTemplateLoader
  • StringType
  • StringVars
  • TemplateFunctions
  • TemplateHighlighter
  • TemplateLoadingException
  • TemplateRenderingException
  • TemplateSyntaxParser
  • TemplateSyntaxParserContext
  • TextHelper
  • TextTemplateSyntaxElement
  • TextType
  • Theme
  • ThemeConfiguration
  • ThemeConfigurationManager
  • ThemesConfig
  • ThemesManager
  • TimeType
  • Timezone
  • Type
  • UnexistingDatabaseException
  • UnexistingExtensionPointProviderException
  • UnexistingHTTPParameterException
  • UnreadContributionsCache
  • UnsupportedOperationException
  • Updates
  • Upload
  • UploadedFile
  • UploadedFileTooLargeException
  • Uploads
  • Url
  • UrlControllerMapper
  • UrlMapping
  • UrlMappings
  • UrlRedirectMapper
  • UrlSerializedParameter
  • UrlSerializedParameterEncoder
  • UrlSerializedParameterParser
  • User
  • UserAccountsConfig
  • UserService
  • ValidationResult
  • VariableExpressionTemplateSyntaxElement
  • VariableTemplateSyntaxElement
  • VisitorDisabledActionAuthorization
  • WizardActionLinkList
  • WizardFormFieldsetSubmit
  • WizardHTMLForm
  • WritingPadConfig
Methods
  • strprotect()
  • wordwrap_html()
  • substr_html()
  • cut_string()
  • to_js_string()
  • to_json_string()
  • htmlspecialchars()
  • htmlspecialchars_decode()
  • html_entity_decode()
  • strtolower()
  • strtoupper()
  • lcfirst()
  • ucfirst()
  • strlen()
  • strpos()
  • stripos()
  • substr()
  • mb_substr()
  • strrchr()
  • strripos()
  • strrpos()
  • strstr()
  • substr_count()
  • convert_case()
  • serialize()
  • serialize_base64()
  • unserialize()
  • mb_unserialize()
  • check_nbr_links()
  • utf8_wordwrap()
  • No protected methods found
  • is_base64()
Properties
  • No public properties found
  • No protected properties found
  • No private properties found
Constants
  • HTML_NO_PROTECT
  • HTML_PROTECT
  • ADDSLASHES_FORCE
  • ADDSLASHES_NONE
  1. APIBoost
  2. \Helper
  3. TextHelper

Class TextHelper

Summary

  • File
  • Package hierarchy Helper
  • Class hierarchy \TextHelper
  • package

    Helper

  • copyright

    © 2005-2020 PHPBoost

  • license

    https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL-3.0

  • author

    Regis VIARRE crowkait@phpboost.com

  • version

    PHPBoost 6.0 - last update: 2018 11 09

  • since

    PHPBoost 3.0 - 2010 01 24

  • contributor

    Julien BRISWALTER j1.seth@phpboost.com

  • contributor

    Arnaud GENET elenwii@phpboost.com

  • contributor

    mipel mipel@phpboost.com

Text helper

Methods

strprotect()

strprotect(string $var, boolean $html_protect = self::HTML_PROTECT, integer $addslashes = self::ADDSLASHES_FORCE) : string

Protects an input variable. Never trust user input!

Parameters
string $var

Variable to protect.

boolean $html_protect

HTML_PROTECT if you don't accept the HTML code (it will be transformed by the corresponding HTML entities and won't be considerer by the web browsers).

integer $addslashes

If you want to escape the quotes in the string, use ADDSLASHES_FORCE, if you don't want, use the ADDSLASHES_NONE constant.

Returns
string —

The protected string.

static
  • Inherited from \TextHelper
Tags
None found

wordwrap_html()

wordwrap_html(string $str, integer $lenght, string $cut_char = '<br />', boolean $cut = true) : string

Inserts a carriage return every $lenght characters. It's equivalent to wordwrap PHP function but it can deal with the HTML entities.

An entity is coded on several characters and the wordwrap function counts several characters for an entity whereas it represents only one character.

Parameters
string $str

The string to wrap.

integer $lenght

The number of characters you want in a line.

string $cut_char

The character to insert every $lenght characters. The default value is '
', the HTML carriage return tag.

boolean $cut

True if you accept that a word would be broken apart, false if you want to cut only on a blank character.

Returns
string —

The wrapped HTML string.

static
  • Inherited from \TextHelper
Tags
None found

substr_html()

substr_html(string $str, integer $start, integer $end = '') : string

Cuts a string containing some HTML code which contains some HTML entities. The substr PHP function considers a HTML entity as several characters.

This function allows you to consider them as only one character.

Parameters
string $str

The string you want to cut.

integer $start

If start is non-negative, the returned string will start at the start 'th position in string , counting from zero. For instance, in the string 'abcdef', the character at position 0 is 'a', the character at position 2 is 'c', and so forth. If start is negative, the returned string will start at the start 'th character from the end of string . If string is less than or equal to start characters long, FALSE will be returned.

integer $end

If length is given and is positive, the string returned will contain at most length characters beginning from start (depending on the length of string ).

Returns
string —

The sub string.

static
  • Inherited from \TextHelper
Tags
None found

cut_string()

cut_string(string $string, integer $length) : string

Cut string to the desired length, ending with the last full word.

Parameters
string $string

A PHP string to convert to cut

integer $length

The desired length

Returns
string —

The substring

static
  • Inherited from \TextHelper
Tags
None found

to_js_string()

to_js_string(string $string, string $add_quotes = true) : string

Exports a variable to be used in a javascript script.

Parameters
string $string

A PHP string to convert to a JS one

string $add_quotes

If true, returned string will be bounded by single quotes

Returns
string —

The js equivalent string

static
  • Inherited from \TextHelper
Tags
None found

to_json_string()

to_json_string(string $string, string $add_quotes = true) : string

Exports a variable to be used in a json javascript script.

Parameters
string $string

A PHP string to convert to a json one

string $add_quotes

If true, returned string will be bounded by double quotes

Returns
string —

The json equivalent string

static
  • Inherited from \TextHelper
Tags
None found

htmlspecialchars()

htmlspecialchars( $string,  $flags = null,  $encoding = 'UTF-8',  $double_encode = true) 

Parameters
$string
$flags
$encoding
$double_encode
static
  • Inherited from \TextHelper
Tags
None found

htmlspecialchars_decode()

htmlspecialchars_decode( $string,  $flags = null) 

Parameters
$string
$flags
static
  • Inherited from \TextHelper
Tags
None found

html_entity_decode()

html_entity_decode( $string,  $flags = null,  $encoding = 'UTF-8') 

Parameters
$string
$flags
$encoding
static
  • Inherited from \TextHelper
Tags
None found

strtolower()

strtolower( $string) 

Parameters
$string
static
  • Inherited from \TextHelper
Tags
None found

strtoupper()

strtoupper( $string) 

Parameters
$string
static
  • Inherited from \TextHelper
Tags
None found

lcfirst()

lcfirst( $string) 

Parameters
$string
static
  • Inherited from \TextHelper
Tags
None found

ucfirst()

ucfirst( $string) 

Parameters
$string
static
  • Inherited from \TextHelper
Tags
None found

strlen()

strlen( $string) 

Parameters
$string
static
  • Inherited from \TextHelper
Tags
None found

strpos()

strpos( $string,  $substring,  $offset = '') 

Parameters
$string
$substring
$offset
static
  • Inherited from \TextHelper
Tags
None found

stripos()

stripos( $string,  $substring,  $offset = '') 

Parameters
$string
$substring
$offset
static
  • Inherited from \TextHelper
Tags
None found

substr()

substr( $string,  $start,  $length = '') 

Parameters
$string
$start
$length
static
  • Inherited from \TextHelper
Tags
None found

mb_substr()

mb_substr( $string,  $start,  $length = '') 

Parameters
$string
$start
$length
static
  • Inherited from \TextHelper
Tags
None found

strrchr()

strrchr( $string,  $needle) 

Parameters
$string
$needle
static
  • Inherited from \TextHelper
Tags
None found

strripos()

strripos( $string,  $needle,  $offset = '') 

Parameters
$string
$needle
$offset
static
  • Inherited from \TextHelper
Tags
None found

strrpos()

strrpos( $string,  $needle,  $offset = '') 

Parameters
$string
$needle
$offset
static
  • Inherited from \TextHelper
Tags
None found

strstr()

strstr( $string,  $needle,  $before_needle = '') 

Parameters
$string
$needle
$before_needle
static
  • Inherited from \TextHelper
Tags
None found

substr_count()

substr_count( $string,  $needle,  $encoding = '') 

Parameters
$string
$needle
$encoding
static
  • Inherited from \TextHelper
Tags
None found

convert_case()

convert_case( $string,  $mode,  $encoding = '') 

Parameters
$string
$mode
$encoding
static
  • Inherited from \TextHelper
Tags
None found

serialize()

serialize( $string) 

Parameters
$string
static
  • Inherited from \TextHelper
Tags
None found

serialize_base64()

serialize_base64( $string) 

Parameters
$string
static
  • Inherited from \TextHelper
Tags
None found

unserialize()

unserialize( $string) 

Parameters
$string
static
  • Inherited from \TextHelper
Tags
None found

mb_unserialize()

mb_unserialize( $string) 

Parameters
$string
static
  • Inherited from \TextHelper
Tags
None found

check_nbr_links()

check_nbr_links(string $contents, integer $max_nbr, boolean $has_html_links = false) : boolean

Checks if a string contains less than a defined number of links (used to prevent SPAM).

Parameters
string $contents

String in which you want to count the number of links

integer $max_nbr

Maximum number of links accepted.

boolean $has_html_links

true if the content is in HTML

Returns
boolean —

true if there are no too much links, false otherwise.

static
  • Inherited from \TextHelper
Tags
None found

utf8_wordwrap()

utf8_wordwrap(string $string, integer $width = 75, string $break = "\n", string $cut = true) : string

Wraps a UTF-8 string to a given number of characters

Parameters
string $string

the input string

integer $width

the column width

string $break

the line is broken using the optional break parameter

string $cut

not used for the moment

Returns
string —

the given string wrapped at the specified column

static
  • Inherited from \TextHelper
Tags
None found

is_base64()

is_base64( $string) 

Parameters
$string
static
  • Inherited from \TextHelper
Tags
None found

Constants

HTML_NO_PROTECT

HTML_NO_PROTECT = false

Tags
None found

HTML_PROTECT

HTML_PROTECT = true

Tags
None found

ADDSLASHES_FORCE

ADDSLASHES_FORCE = 1

Tags
None found

ADDSLASHES_NONE

ADDSLASHES_NONE = 2

Tags
None found
Documentation is powered by phpDocumentor and generated on Thu, 25 Jun 2020 11:10:26 +0200.