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 Link to comment https://forums.phpfreaks.com/topic/60678-strip/ 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; } ?> Link to comment https://forums.phpfreaks.com/topic/60678-strip/#findComment-301867 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()); Link to comment https://forums.phpfreaks.com/topic/60678-strip/#findComment-301868 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. Link to comment https://forums.phpfreaks.com/topic/60678-strip/#findComment-301889 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.