如何在添加文本“Uhr”的String中设置第三个运算符?

I need to add "Uhr" at the end of the following Code:

<?
$doc = JFactory::getDocument();
            $doc->setTitle($event->title . " | Example");
            $doc->setDescription($event->title . " am " . $event->start, 'end' -> $event->end "uhr needs to be here");
?>

how can I archive this? Because if I add a . "Uhr" it doesn't work :(

$doc->setDescription($event->title . " am " . $event->start . ", " . $event->end . " Uhr");

should do it.

Formatted dates:

$doc->setDescription($event->title . " am " . date('d.m.Y', strtotime($event->start)) . ", " . date('H:i', strtotime($event->end)) . " Uhr");

I think there is something wrong with the last ->. Maybe this works:

$doc->setDescription($event->title . " am " . $event->start, 'end' . $event->end . "uhr");

In case "am", "end" and "urh needs to be here", best you use the same quotes like:

<?
$doc = JFactory::getDocument();
$doc->setTitle($event->title . " | Tanzschule Hartung");
$doc->setDescription($event->title . " | Tanzschule Hartung" " am " . $event->start, "end" -> $event->end . "uhr needs to be here");
?>

(look at your text 'end', compared to the code above)

It looks like $event->start (and others) need to display some text which is requested.

Why you need to use a . (dot) after requesting text from another function is because PHP needs to understand when it has to display text or not.

The . is the string concatenation operator.

This might work as well:

<?
$doc = JFactory::getDocument();
// Setting titles
$title = $doc->setTitle($event->title);
$start = $event->start;
$end   = $event->end;

$doc->setDescription($title . " | Tanzschule Hartung am " . $start . " , end" . $end . "uhr needs to be here");
?>

I hope this clears something up.

If you have any questions, feel free to ask.