Below is my code:
<?php
$array = explode("
", $order['payment_address']);
$firstLine = $array[0];
echo $firstLine;
?>
What i am trying to do is grab the name of customer in first line from $order['payment_address'] and print it. Payment_address includes several lines with customer name on top. Tried the code by Ben Pearl Kahan and output is now as -
Bob Smith 12
Line 1: Bob Smith 12 Line 2: Kannaught Place Delhi 282010 Uttar Pradesh India
While i want just "Bob Smith".
I am a novice. Plz help.