Skip to content
Advertisement

Tag: string

“Function split() is deprecated” in PHP?

Deprecated: Function split() is deprecated in C:wampwwwRSS.php on line 27 Why this error happen ? Answer http://php.net/manual/en/function.split.php From the manual Warning This function has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged Note: As of PHP 5.3.0, the regex extension is deprecated in favor of the PCRE extension. Calling this function will issue an E_DEPRECATED

Stripping a string of its non-numeric characters

I have a phone number stored in $phone, it looks like this: (555) 555-5555. I want it to look like this: 5555555555. How do I take the string and strip it of hyphens, spaces, and parenthesis? Answer With a regexp. Specifically, use the preg_replace function:

Javascript Equivalent to PHP Explode()

I have this string: 0000000020C90037:TEMP:data I need this string: TEMP:data. With PHP I would do this: How do I effectively explode a string in JavaScript the way it works in PHP? Answer This is a direct conversion from your PHP code:

In PHP, what does “<<<" represent?

For example: Answer That’s heredoc syntax. You start a heredoc string by putting <<< plus a token of your choice, and terminate it by putting only the token (and nothing else!) on a new line. As a convenience, there is one exception: you are allowed to add a single semicolon after the end delimiter. Example:

Advertisement