Is there a one line way to combine getting first and last character of a string?
I tried (without success):
$title = "IncredibleTitle";
$title_characters = (mb_substr($title, 0, 1, 'UTF8')) && (mb_substr($title, 0, -1, 'UTF8'));
Is there a one line way to combine getting first and last character of a string?
I tried (without success):
$title = "IncredibleTitle";
$title_characters = (mb_substr($title, 0, 1, 'UTF8')) && (mb_substr($title, 0, -1, 'UTF8'));
.
period character for concatenation.mb_substr
.Snippet:
<?php
$title = "IncredibleTitle";
$title_characters = (mb_substr($title, 0, 1, 'UTF8')) . (mb_substr($title, -1, 1, 'UTF8'));
echo $title_characters;