jwerre wrote:It's posting fine if i put a space after the "[ " or if i put one before " ]" Any idea why that would be?
That is strange since extra spaces should have no consequence. As a demonstration, I suggest that you try running this as a separate script:
<?php
function is_home() {
return true;
}
if (is_home()) {
$flashContent = '[kml_flashembed movie="http://www.myMovie.swf width="760" height="380"' . '/' .']';
echo "<div id='flashContent'>" . $flashContent . "</div>";
}
?>
Incidentally, note that you are probably missing a double quote after '"http://www.myMovie.swf', and that the concatenation of the '/' and ']' is unnecessary since it can be just one string literal (and in fact, as YAOMK implicitly observed, you do not need the $flashContent variable at all).
Actually, what are you trying to do? That the insertion of spaces after '[' or before ']' makes a difference suggests that something else is at work here that you did not mention.
php_dev wrote:maybe the space is working because without them PHP interprets the [] as an array index
That is not possible since single quoted strings are used to initialise $flashContent. Even with double quoted strings it should not happen since no variable is embedded.