Jump to content

kaplak

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Everything posted by kaplak

  1. Here's a link to the case in question, if someone who stumbles upon this thread wants to know : http://wordpress.org/support/topic/215727
  2. Thanks a lot for clearing that up! Thanks for the link! It works perfectly - $tags is really changed by the loop now! This got me a long way - been struggling to get this working all day. This forum seems like a very good place with lots of very useful advice. Now I face how to get the value of that array into the WordPress database. But that's a different problem :-)
  3. I'm sure this must have been covered a thousand times, but can't find anything anywhere about this. I want to get $tags, which is an array with a set of existing values to get the new values from this loop : $search = ";"; $replace = ""; if (count($tags) > 0) { foreach ($tags as $tag) { echo "LOOP 1:"; echo $tag; $cleantag = str_replace($search, $replace, $tag); $tag = $cleantag; echo "LOOP 2:"; echo $tag; $tags[$tag->name] = $cleantag; echo "LOOP 3:"; echo $tags[$tag->name]; } } echo "<p>TAGS :</p>"; print_r($tags); The loop works great in that it successfully removes the semicolons, which is verified by echo'ing the values of the individual variables in the loop. Everything seems to go right. But when printing the value of the $tags array after this loop all semicolons are still there. How can I get $tags to contain the new values from the loop? I can't get it into my head, how it would not work. I'm a PHP newbie, but I'm a quick learner. This is used in a WordPress plugin btw, but strikes me as more of a PHP issue, why I post it here, where there's a bigger chance to get help :-) Thanks for your help in advance!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.