Title: Replace split() with preg_split() for PHP 7
Last modified: October 19, 2017

---

# Replace split() with preg_split() for PHP 7

 *  [awijasa](https://wordpress.org/support/users/awijasa/)
 * (@awijasa)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/replace-split-with-preg_split-for-php-7/)
 * Hello,
 * I ran a PHP Compatibility Checker ([https://wordpress.org/plugins/php-compatibility-checker/](https://wordpress.org/plugins/php-compatibility-checker/))
   to check for PHP 7 compatibility. It is listing a couple errors related to Post
   SMTP. Both are about the use of split instead of preg_split.
 * On /Postman/Postman-Connectivity-Test/registered-domain-libs-master/generateEffectiveTLDs.
   php:
 * Line 153: Replace `$lines = split("\n", $list);` with `$lines = preg_split("\
   n", $list);`
 * Line 179: Replace `$tldParts = split('\.', $line);` with `$tldParts = preg_split('\.',
   $line);`
 * Thanks,
 * [@awijasa](https://wordpress.org/support/users/awijasa/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Neil Murray](https://wordpress.org/support/users/buzztone/)
 * (@buzztone)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/replace-split-with-preg_split-for-php-7/#post-9613783)
 * [@awijasa](https://wordpress.org/support/users/awijasa/) – Would be great if 
   you (or someone else) could add this as an [Issue on the Github Repo](https://github.com/yehudah/Post-SMTP/issues).
 *  Thread Starter [awijasa](https://wordpress.org/support/users/awijasa/)
 * (@awijasa)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/replace-split-with-preg_split-for-php-7/#post-9613836)
 * Thanks [@buzztone](https://wordpress.org/support/users/buzztone/)!
 * I didn’t know GitHub is the primary issue tracker for Post SMTP.
 * This has been added as an issue there.
 * [@awijasa](https://wordpress.org/support/users/awijasa/)
 *  [yehudah](https://wordpress.org/support/users/yehudah/)
 * (@yehudah)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/replace-split-with-preg_split-for-php-7/#post-9614157)
 * Hi [@awijasa](https://wordpress.org/support/users/awijasa/)
 * GitHub is not the primary tracker because it is not so convenient to most of 
   the people.
 * Thanks for alerting, I will fix it as soon as possible.
 *  Thread Starter [awijasa](https://wordpress.org/support/users/awijasa/)
 * (@awijasa)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/replace-split-with-preg_split-for-php-7/#post-9614167)
 * Thanks [@yehudah](https://wordpress.org/support/users/yehudah/)!
 * For next time, I’ll use this support forum.
 * [@awijasa](https://wordpress.org/support/users/awijasa/)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Replace split() with preg_split() for PHP 7’ is closed to new replies.

 * ![](https://ps.w.org/post-smtp/assets/icon-128x128.gif?rev=3209655)
 * [Post SMTP – Complete Email Deliverability and SMTP Solution with Email Logs, Alerts, Backup SMTP & Mobile App](https://wordpress.org/plugins/post-smtp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/post-smtp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/post-smtp/)
 * [Active Topics](https://wordpress.org/support/plugin/post-smtp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/post-smtp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/post-smtp/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [awijasa](https://wordpress.org/support/users/awijasa/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/replace-split-with-preg_split-for-php-7/#post-9614167)
 * Status: not resolved