Top "Preg-split" questions

preg_split() is a PHP function which allows splitting a string using a regular expression.

how to use preg_split() in php?

Can anybody explain to me how to use preg_split() function? I didn't understand the pattern parameter like this "/[\s,]+/". …

php preg-split
Split a text by a backslash \ ?

I've searched for hours. How can I separate a string by a "\" I need to separate HORSE\COW into two …

php explode preg-split
Regular expression for preg_split() by new line

This is my file: 0.0 5.0 5.0 6.0 7.0 2.0 5.0 2.0 1.0 5.0 5.0 1.0 2.0 7.1 5.0 5.0 0.0 5.0 5.0 5.0 2.0 5.0 1.0 5.0 6.0 6.0 6.0 6.0 1.0 7.1 5.0 5.0 0.0 6.0 1.0 6.0 5.0 5.0 1.0 6.0 5.0 7.0 1.0 5.0 6.0 6.0 5.0 6.0 0.0 5.0 2.0 1.0 6.0 5.0 6.0 2.0 1.0 2.0 1.0 5.0 7.0 5.0 1.0 5.0 0.0 7.0 1.0 1.0 2.0 1.0 5.0 6.0 2.0 2.0 5.0 2.0 2.0 6.0 2.0 7.0 0.0 5.0 5.0 6.0 5.0 2.0 5.0 1.0 2.0 5.0 5.0 5.0 5.0 1.0 1.0 5.0 0.0 2.0 6.0 1.0 5.0 7.0 5.0 1.0 6.0 7.0 1.0 5.0 1.0 2.0 2.0 1.0 5.0 6.0 5.0 2.0 6.0 7.0 0.0 5.0 5.0 7.0 6.0 5.0 5.0 5.0 6.0 2.0 6.0 2.0 1.0 5.0 6.0 5.0 0.0 I would split it by \n and have returned in one array each row. How can …

php regex preg-split
PHP split to preg_split()

I wanted to convert the following split function, which I have been using to preg_split.. it's a little confusing, …

php regex split preg-split
How do I include the split delimiter in results for preg_split()?

I have this simple pattern that splits a text into periods: $text = preg_split("/[\.:!\?]+/", $text); But I want to include . : …

php preg-split
Using Preg_Split With Multiple Spaces

I'm having a bit of trouble figuring this out. I have lines of data such as this: $data = "Alpha Natural …

php preg-split
PHP preg_split: Split string by forward slash

I want to split my string 192.168.1.1/24 by forward slash using PHP function preg_split. My variable : $ip_address = "192.168.1.1/24"; I have …

php string preg-split
In PHP, which is faster: preg_split or explode?

This may sound like a stupid question, but: which is faster when using it to extract keywords in a search …

php explode preg-split
how to remove multiple slashes in URI with 'PREG' or 'HTACCESS'

how to remove multiple slashes in URI with 'PREG' or 'HTACCESS' site.com/edition/new/// -> site.com/edition/…

php .htaccess preg-replace preg-match preg-split
PHP REGEX - text to array by preg_split at line break

EDITED: need help on split Array array example: array ( [0] => :some normal text :some long text here, and so on... …

php regex preg-split line-breaks