Skip to content

Tag: split

How to split text based on specific word

I have a text which contains the word “Article” many times for example: My text title Article 1 bla bla Article 2 bla bla … I want to split the text like this: Answer Instead of trying to find a split pattern, you should look for a matching pattern: It matches Article, followed by anything u…

“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 extensi…

Split a string array into pieces

Let’s say I have an array that store like this: How should I make the array[0] string split into piece by separated the “;”? Then I want to save them in array again, or display them out. How should I do it? Answer I would personally use the preg_split to get rid of that extra array element t…