1

I currently have a variable setup in one php file:

<?php
$images_url = "http://foo.bar.com/helloworld/images/";
?>

I have a different file in which I have an array. Here's a snippet of the array:

'image'   => '<img src="urlencode($images_url);/news/20140528.jpg" />';

I'm guessing urlencode() is not the correct tool, but it's the most recent one I've tried.

PS. Please excuse any formatting issues, as this was composed on my phone.

1
  • 'image' => '<img src="' . urlencode($images_url) . '/news/20140528.jpg">' Commented Aug 12, 2014 at 4:29

2 Answers 2

1

Try the following instead:

'image' => '<img src="' . urlencode($images_url) . '/news/20140528.jpg" />'

Sign up to request clarification or add additional context in comments.

1 Comment

Didn't quite work, but you put me on the right track. I used 'image => '<img src="' . ($images_url) . '/news/20140528.jpg">'
0

try this

 'image' => '<img src="' . urlencode($images_url) . '/news/20140528.jpg" />';

1 Comment

There shouldn't be a semi-colon in an array definition

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.