php - Why am I getting an extra space when I remove this line break? -


$metainfo = file_get_contents('assets/php/'.$url[0].'/meta.ini'); $metainfo = str_ireplace("\n","&",$metainfo); 

the data looks before strip break tags , replace ampersand:

[page information] pagefile=main.php pagetitle=home page  [overwrite meta tags]     metadescription=the main page in our website. metakeywords=my, insanely, awesome, website metaauthor=jake andreoli 

the data after i'm done:

[page information] &pagefile=main.php &pagetitle=home page &[overwrite meta tags] & &metadescription=the main page in our website. &metakeywords=my, insanely, awesome, website &metaauthor=jake andreoli 

while correct, adds additional space every variable. can't figure out, me out?

there either trailing space @ end of each line or there \r may causing it. open in editor show \r , find trailing spaces. if space, replace on " \n". if \r replace "\r\n" (common on windows).


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

java.util.scanner - How to read and add only numbers to array from a text file -

iphone - Three second countdown in cocos2d -