MDanz Posted February 6, 2010 Share Posted February 6, 2010 when using this code $keywords = $tags['keywords']; and inputting in mysql, their is a space before the keyword. e.g. keyword ^ space before k How do i eliminate spaces at the beginning of the entry? Link to comment https://forums.phpfreaks.com/topic/191192-variable-help/ Share on other sites More sharing options...
lynxus Posted February 6, 2010 Share Posted February 6, 2010 you could maybe use str_replace? str_replace(' ', '', $tags); http://php.net/manual/en/function.str-replace.php ? Link to comment https://forums.phpfreaks.com/topic/191192-variable-help/#findComment-1008068 Share on other sites More sharing options...
MikeDean89 Posted February 6, 2010 Share Posted February 6, 2010 I know this is solved, but you're able to do this using the trim() function. $keywords = trim( $tags['keywords'] ); That should work Link to comment https://forums.phpfreaks.com/topic/191192-variable-help/#findComment-1008071 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.