-1

I want to define variable like this.

$dhara = "<a href="$media['url']"><img src="$media['url']" alt="test.jpg"  class="alignnone size-full" /></a>";

But this gives me this error:

Parse error: syntax error, unexpected '$dhara' (T_VARIABLE)

How to do this? I want to define or use varialbe like this:

 $dhara = "<a href="$media['url']">"

1 Answers1

-1

I tested your code; if I am right there is concatenation (.) error in your program. You must use concatenation if you're adding variable with string or adding two variables.

Eg $merge = $first_var .$second_var

You must write in that way:

"; echo $dhare; ?>

Happy to help. fb.com/waytoprashant

Alex Shesterov
  • 26,085
  • 12
  • 82
  • 103
Prashant
  • 394
  • 1
  • 6
  • 18