Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize Online / SQLize Online  /  SQLtest Online

A A A
Login    Share code      Blog   FAQ

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

Copy Format Clear

Stuck with a problem? Got Error? Ask AI support!

Copy Clear
Copy Format Clear
<?php function getComment($senderComment, $recComment) { $comment = []; if (!empty($senderComment)) { $comment[] = $senderComment; } if (!empty($recComment)) { $comment[] = $recComment; } if (empty($comment)) { return null; } $fullComment = implode('. ', $comment); var_dump($fullComment); $comment = mb_substr($fullComment, 0, 255); var_dump($comment); return $comment; } $senderComment = '156016, Кос тромская обл., г. Кострома, мкр-н Давыдовский-3, д.32, пом. 1, ком. 112\156016, Кос тромская обл., г. Кострома, мкр-н Давыдовский-3, д.32, пом. 1, ком. 112'; $recComment = '+79009111011 Коротков Денис'; $a = getComment($senderComment, $recComment);
Copy Clear