shage Posted July 19, 2007 Share Posted July 19, 2007 $post_title = get_the_title(); That code will give me The Title I need it to give me the_title i have figured that str_replace(" ", "_", strtolower(strval(trim(INF)))); would do it but cant figure out who to use it in the code or if thats even right Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted July 19, 2007 Share Posted July 19, 2007 are you trying to get the page's title I use this method <?php $url = $_GET['URL']; if($content=file_get_contents($url)){ $title_start = strpos($content,"<title>"); $title_length = strpos($content,"</title>")-$title_start; $title = substr($content,$title_start,$title_length); //This should be the title $title = str_replace("</title>","",$title); $title = str_replace("<title>","",$title); echo $title; } ?> Quote Link to comment Share on other sites More sharing options...
trq Posted July 19, 2007 Share Posted July 19, 2007 Simply use... $post_title = str_replace(' ','_',get_the_title()); Quote Link to comment Share on other sites More sharing options...
Hypnos Posted July 19, 2007 Share Posted July 19, 2007 $post_title = get_the_title(); That code will give me The Title I need it to give me the_title i have figured that str_replace(" ", "_", strtolower(strval(trim(INF)))); would do it but cant figure out who to use it in the code or if thats even right You're right. But you shouldn't need the strval. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.