How can i get the title of WordPress post in this php code
<?php include("imdb.php"); $imdb = new Imdb(); $movieArray =
$imdb->getMovieInfo("**.get_the_title().**"); echo '<table
cellpadding="3" cellspacing="2" border="1" width="80%"
align="center">'; foreach ($movieArray as $key=>$value){
$value = is_array($value)?implode("<br />", $value):$value;
echo '<tr>';
echo '<th align="left" valign="top">' . strtoupper($key) . '</th><td>' . $value . '</td>';
echo '</tr>'; } echo '</table>'; ?>
I tried to put ".get_the_title()." but don’t result the title of current post.
I assume your code is in a wordpress loop, so you just have to use :
Using
$imdb->getMovieInfo("**.get_the_title().**");don’t work since PHP don’t handle function inside strings : http://www.php.net/manual/language.types.string.php