Created
March 30, 2023 08:40
-
-
Save adicahyaludin/eb2c88f00a7669ccadb5a39434a12e83 to your computer and use it in GitHub Desktop.
textarea to array in php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$textarea_string = 'lorem | |
ipsum | |
dolor | |
sit | |
amet'; | |
$textarea_arr = preg_split('/[\r\n]+/', $textarea_string, -1, PREG_SPLIT_NO_EMPTY); | |
echo '<pre>'.print_r($textarea_arr,1).'</pre>'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment