split string using delimiter php code example

Example 1: split array with comma php

// ------------------------------------------------
// php implode / explode

"expiry": [
  "94 Paracoins will expiry date 2020-10-28",
  "20 Paracoins will expiry date 2020-12-15",
  "2 Paracoins will expiry date 2020-12-20",
  "2 Paracoins will expiry date 2021-01-22",
  "8 Paracoins will expiry date 2021-01-28"
]

$expiry = implode(", ", $expiry);

//=> $expiry_message 
=> $expiry = "94 Paracoins will expiry date 2020-10-28, 20 Paracoins will expiry date 2020-12-15, 2 Paracoins will expiry date 2020-12-20, 2 Paracoins will expiry date 2021-01-22, 8 Paracoins will expiry date 2021-01-28"

Example 2: how to split sting in php

<?php
list($user, $pass, $uid, $gid, $extra) =
    split(":", $passwd_line, 5);
?>

Tags:

Php Example