<?php
$pattern = '/[;,]/';
$string = "something here ; and there, oh,that's all!";
echo '<pre>', print_r( preg_split( $pattern, $string ), 1 ), '</pre>';
More Related Contents:
- How to split a long string without breaking words?
- Find a match pattern of any digit and space with any character in a string and replace with | in PHP [closed]
- Remove new lines from string and replace with one empty space
- How to remove accents and turn letters into “plain” ASCII characters? [duplicate]
- Capturing text between square brackets in PHP
- PHP: Split string [duplicate]
- Remove multiple whitespaces
- How do I remove all specific characters at the end of a string in PHP?
- How to remove non-alphanumeric characters?
- How to mimic Stack Overflow Auto-Link Behavior
- Remove control characters from PHP string
- PHP remove special character from string
- Split camelCase word into words with php preg_match (Regular Expression)
- PHP – split String in Key/Value pairs
- Php – regular expression to check if the string has chinese chars
- Split alphanumeric string between leading digits and trailing letters
- PHP: Split string into array, like explode with no delimiter
- PHP – Add link to a URL in a string
- Get last whole number in a string
- Close open HTML tags in a string
- Regex & PHP – isolate src attribute from img tag
- Remove accents without using iconv
- Remove all non-numeric characters from a string; [^0-9] doesn’t match as expected
- How to prefix a positive number with plus sign in PHP
- How to remove numbers from a string with RegEx
- How to validate that a string only contain lowercase letters?
- Regex to match an IP address [closed]
- Replacing accented characters php
- How can I use .htaccess to hide .php URL extensions?
- How do I replace double quotes with single quotes