1

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"

1
  • What have you tried to resolve the problem? Where are you stuck? Why not use str_replace? Commented May 2, 2023 at 19:55

2 Answers 2

3

Just remove the space with str_replace():

echo str_replace(' ', '', $closed);
Sign up to request clarification or add additional context in comments.

Comments

0

Just use the . for example:

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

it will display as "not yet"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.