0

I am trying to insert some PHP/HTML mix inside of a PHP variable.

$media = '<br>'date('F j, Y, g:i a', strtotime( $key['date'] ))'<br>';

But it doesn't work whatever i try. Any help appreciated.

2
  • stackoverflow.com/help/how-to-ask Commented Dec 16, 2019 at 9:57
  • How am i supposed to ask any other way that i did. It's a clear question. Commented Dec 16, 2019 at 9:58

1 Answer 1

3

to mix variables in php you must use .(dot). for your question. you must do it like this:

$media = '<br>'.date('F j, Y, g:i a', strtotime( $key['date'] )).'<br>';
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks so much ttrasn. I knew i had to use the dots, but i put them in the wrong places i guess. I'm no professional coder and have a night straight behind me, i'm done and i need sleep, that's probably why my brain don't function. I appreciate your help a lot. have a good day!

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.