John Kerby
John Kerby

Reputation: 83

Insert some PHP/HTML mix inside of a PHP variable

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.

Upvotes: 0

Views: 68

Answers (1)

ttrasn
ttrasn

Reputation: 4826

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>';

Upvotes: 3

Related Questions