- This topic is empty.
-
AuthorPosts
-
March 8, 2010 at 3:13 am #28179as3kParticipant
Hey all,
Im new to the board and wanted to see if you all could help me out.
Im currently trying to display an image using the explode(); function.
I looked at tutorials online and tried to search the forum but im not finding
anything. A snippet of code is attatched to this can anybody tell me what im doing
wrong?Thanks in advance
ZackMy string to be exploded was like this "http://www.anyurl.com/img.png|altTag"
Code:I had the code as this before and it didnt give me errors, but did not show the content.
Code:ID, ‘specials’ , true);$img = explode(“|”,$SpecialOffers);
$imgUrl = $img[0];
$imgAlt = $img[1];?>
March 8, 2010 at 3:20 am #72131davesgonebananasMemberNot sure if the space in $post-> ID is causing a problem. Might be better to change it to $post->ID.
Looks like you have correctly created your $img variable, you just need to echo it to output it.
Code:March 8, 2010 at 4:07 am #72132Rob MacKayParticipantAs long as the list you are trying to explode is separated with "|" and not a standard "," you should be fine :)
March 8, 2010 at 4:40 pm #69798as3kParticipant"davesgonebananas" wrote:Not sure if the space in $post-> ID is causing a problem. Might be better to change it to $post->ID.Looks like you have correctly created your $img variable, you just need to echo it to output it.
Code:Found my problem, I forgot to echo out my php, Can’t believe i forgot tht lol… although errors like that are usually the simplest to take care of.
Thanks again guys
March 8, 2010 at 4:46 pm #69800davesgonebananasMemberWe all have days like that!!!
March 8, 2010 at 5:24 pm #69801Rob MacKayParticipantwoohoo awesome :D
March 10, 2010 at 12:54 am #72148MakeshiftMemberAuthorPostsViewing 7 posts - 1 through 7 (of 7 total)- The forum ‘Back End’ is closed to new topics and replies.