I was expecting the output would be:
But the actual output is: ""
$condition = true;
$categoryId = 123;
$result = 'http://domain.dev/category' . empty($condition) ? '' : '/' . $categoryId;
var_dump($result);
From what I understand - it check if empty($condition)
is empty - if true then append http://domain.dev/category
with ''
OR else /$categoryId
What did I do wrong?