I’m having some trouble parsing a first name and last name from a string into 2 different variables.
The string is always in this format: “Smith, John” or “Doe, Jane”
Is there a function out that can split the first and last name to 2 different variables to something like…
$firstname = "John"
$lastname = "Smith"
Use
listwithexplodelike this:You may need to use
trimto remove any whitespace from those vars.