How do I add a space in the returned text between sample1 and sample2? Here is what I have so far:
if ($eventid!="") {
echo $get_event['sample1'], $get_event['sample2'];
}
It's really simple, just echo a space between the variables...
<?php if($eventid!=""){echo $get_event['sample1'] , ' ', $get_event['sample2']; }
Indentation always make things cleaner and easier:
if (!empty($eventid)) {
echo $get_event['sample1'] . ' ' . $get_event['sample2'];
}
On PHP, you need to use a dot (.) to concatenate strings... as you can see on the Strings Operators documentation:
http://php.net/manual/en/language.operators.string.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With