User Tools

Site Tools


programmieren:php:pcre_functions:preg_split

preg_split

preg_split also pretty peak. It splits a string into an array using the defined pattern as a separator.

This is useful to split every new line into their own array so it makes each line alot easier to compare.

Usage

$separatedPatch = preg_split('/\R/', $this->patchData);

This splits the patch data along every new line, so I can evaluate each one individually.

programmieren/php/pcre_functions/preg_split.txt · Last modified: by admin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki