Answer the question
In order to leave comments, you need to log in
Generating 'title' via $_GET request?
I want to generate 'title' via $_GET request:
How to do, if $street data exists, then add the word STREET.
And if the parameter
then add the word REFERENCE.
But if there is no "street" value, then the word street is not displayed.
I output the title like this:
$street = $_GET["street"];
$orient = $_GET["orient"];
'title' => $street. "". $orient
Answer the question
In order to leave comments, you need to log in
$street = htmlspecialchars($_GET["street"] ?? '');
$orient = htmlspecialchars($_GET["orient"] ?? '');
return [
'title' => trim ( ($street ? "Улица $street" : "") . " " . ($orient ? "Ориентир $orient" : "") ),
];
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question