Log 1956

$fullName = #שם מלא#;

// Remove any leading or trailing white spaces from the full name
$fullName = trim($fullName);

// Count the number of words in the full name
$numWords = count(explode(” “, $fullName));

if ($numWords == 2) {
// If there are two words, assign the first word to firstName and second word to lastName
list($firstName, $lastName) = explode(” “, $fullName);
} elseif ($numWords == 3) {
// If there are three words, assign first two words to firstName and third word to lastName
list($firstName, $middleName, $lastName) = explode(” “, $fullName);
} elseif ($numWords >= 4) {
// If there are four or more words, assign first three words to firstName and fourth word onwards to lastName
list($firstName, $middleName1, $middleName2, …$lastNamesArray) = explode(” “, $fullName);

// Combine all last names into a single string separated by space
$lastName = implode(” “, $lastNamesArray);
}

return “First Name: ” . (isset($firstName) ? htmlentities($firstName) : “”) . “
“;
return “Last Name: ” . (isset($lastName) ? htmlentities($lastName) : “”);

Select the fields to be shown. Others will be hidden. Drag and drop to rearrange the order.
  • Image
  • SKU
  • Rating
  • Price
  • Stock
  • Availability
  • Add to cart
  • Description
  • Content
  • Weight
  • Dimensions
  • Additional information
  • Attributes
  • Custom attributes
  • Custom fields
Click outside to hide the comparison bar
Compare