smask Posted August 8, 2006 Share Posted August 8, 2006 Hello! I was wondering if anyone happens to know if there are some convenient way to print the urls of the categorie's images as variables? example: url of the image of category1 printed as $variable1 url of the image of category2 printed as $variable2 And while I'm at it, i also wonder if it's possible to print the url image of product image x as a variable? Thanks in advance & for reading! Quote Link to comment Share on other sites More sharing options...
smask Posted August 16, 2006 Author Share Posted August 16, 2006 Bump! Anyone? I'm willing to pay a 15$ donation through paypal for a working solution. Quote Link to comment Share on other sites More sharing options...
smask Posted August 20, 2006 Author Share Posted August 20, 2006 Solved it myself. echo $product_info['products_image'] prints the url of product image and $imageurls .= $row['categories_image'] . ' ' ; // from php.net // split a string into an array of space-delimited tokens, taking double-quoted strings into account function tokenizeQuoted($string) { for($tokens=array(), $nextToken=strtok($string, ' '); $nextToken!==false; $nextToken=strtok(' ')) { if($nextToken{0}=='"') $nextToken = $nextToken{strlen($nextToken)-1}=='"' ? substr($nextToken, 1, -1) : substr($nextToken, 1) . ' ' . strtok('"'); $tokens[] = $nextToken; } return $tokens; } $tokens = tokenizeQuoted($imageurls); outputs the categories image urls as $tokens[0], $tokens[1], $tokens[2] etc Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.