Jump to content

WTF HeLp Me PlZ


tarun

Recommended Posts

Switch your use of single and double quotes. Or use concatenation.

[code]<?php
if (strstr($file, '.jpg'))
    echo "<img src='$file'>"; // parenthesis are not needed on an "echo" statement
else
    echo 'Unknown File Type';
?>[/code]

or

[code]<?php
if (strstr($file, '.jpg'))
    echo '<img src="' . $file . '">';
else
    echo 'Unknown File Type';
?>[/code]

Ken
Link to comment
https://forums.phpfreaks.com/topic/30266-wtf-help-me-plz/#findComment-139202
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.