user3212831
user3212831

Reputation: 101

PHP Echo Without Spaces

I want to do an echo without having a space, even if I define it with a space.

This is how I defined it:

$closed = 'not yet';

I want it so if I put this (with whatever removes the space):

<?php echo $closed ?>

it will display like "notyet" instead of "not yet"

Upvotes: 1

Views: 3873

Answers (2)

philip dewanto
philip dewanto

Reputation: 13

Just use the . for example:

$closed = 'not' . 'yet';
<?php echo $closed ?>

it will display as "not yet"

Upvotes: 0

John Conde
John Conde

Reputation: 219804

Just remove the space with str_replace():

echo str_replace(' ', '', $closed);

Upvotes: 3

Related Questions