Can anyone make sense of this:
I'm trying to make a formatted email which sends to outlook express details of a customers wishlist.
I won't post all the code but basically after much much much trial and error it all comes down to one "FOR" loop in php and within that the length of one hardcoded string!
For example:
//big for loop for entire array
for ($i = 0; $i < $num_rows; $i++){
$wishlist_ref = $wishlist_array[$i];
[COLOR="Red"]//works!
$image_link = "http://www.burlingtonjewellers.com/abcdefghijkl/$wishlist_ref.jpg";[/COLOR]
$list_gen = $list_gen."<tr><td>$image_link</td></tr>";
}[/COLOR]
This generates a nice list of image links:
http://www.burlingtonjewellers.com/abcdefghijkl/79298_B.jpg
http://www.burlingtonjewellers.com/abcdefghijkl/79298_F.jpg
http://www.burlingtonjewellers.com/abcdefghijkl/79298_G.jpg
http://www.burlingtonjewellers.com/abcdefghijkl/75299.jpg
http://www.burlingtonjewellers.com/abcdefghijkl/79120_CZ. jpg
http://www.burlingtonjewellers.com/abcdefghijkl/79128.jpg
But if I make that hardcoded string in that loop just one character longer, i.e this:
//big for loop for entire array
for ($i = 0; $i < $num_rows; $i++){
$wishlist_ref = $wishlist_array[$i];
[COLOR="Red"]//doesn't work!
$image_link = "http://www.burlingtonjewellers.com/abcdefghijkl[COLOR="DeepSkyBlue"]m[/COLOR]/$wishlist_ref.jpg";[/COLOR]
$list_gen = $list_gen."<tr><td>$image_link</td></tr>";
}[/COLOR]
Note, everything is the same but now the results have an unwarranted white space which breaks the image link:
http://www.burlingtonjewellers.com/abcdefghijklm/79298_B.jpg
http://www.burlingtonjewellers.com/abcdefghijklm/79298_F.jpg
http://www.burlingtonjewellers.com/abcdefghijklm/79298_G.jpg
http://www.burlingtonjewellers.com/abcdefghijklm/75299.jpg
http://www.burlingtonjewellers.com/abcdefghij klm/79120_CZ.jpg
http://www.burlingtonjewellers.com/abcdefghijklm/79128.jpg
sometimes the gap appears here like http://ww w.burling.... or other places and it normally happens in the 11th item, if the customers wish list only contains say 10 items it works fine.
I've tested the generated html many times in both firefox and IE, its only mail programs like outlook express and yahoo mail where this extra white space appears.
I've tried doing a string replace for white space but it still doesn;t work.
Can anyone help, I've spent 2 days on this, it really is bizarre, I cannot understand why a 48 char hardcoded value works and a 49 char length one fails!
Makes no sense....arrrrhhhhhh can anyone help!! 🙂