Jump to content

kellan4459

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Everything posted by kellan4459

  1. I am trying to split a simple string from my db it is in the format #/# 1/5 2/5 3/3 4/2 etc... I have the following: echo $value.'<BR>'; $temp=explode('/',$value['field']); print_r($temp); echo '<br>'; when I execute the above (it's in a for loop) I get the following output 1/5 Array ( [0] => 1 ) 2/5 Array ( [0] => 2 ) 3/3 Array ( [0] => 3 ) 4/2 Array ( [0] => 4 ) I am expecting 1/5 Array ( [0] => 1 [1] => 5) for the first entry and so on down the line showing both values after the explode.
  2. I changed from $this->variable_name to global declaration of the variable. That fixed my issue.
  3. I am using a MVC framework and in my controller I have defined a class variable for configurations. In my action I have a call to the configuration class to set the class variable to the current configurations. public $configArray = array(); public function actionBuild($id) { $this->configArray=Config::model()->getConfigArray($id); $this->buildStep1(); ... } When I echo the configuration in the method it is 10 but when I echo in buildStep1 it is 11. What is the proper way for configArray to be global and updated when I call getConfigArray for use in functions in the class?
  4. I realized I had a flaw when I looked at your response. I want know the return value without touching all items. If I have the following 1->4->16 4->32 200->40 450->209 ->274->316 ->490 I need to check if the current id is linked to one that has already been added and if so is it the first entered for the current session by date I am thinking I will need to pass a variable to the function to old the value as I recurse through
  5. I am trying to work through an array of people links and return a certain person based on some comparisons. This is a multidimensional array with some levels having more links than others so you could have it would look more like a tree structure. I have a function public function handlelinkL1Links($linkLinksArray) { foreach($linkLinksArray as $key=>$value) { if(array_search($key,$this->linkProcessed)===false && $this->compareKey($key)==true) { $linkToAdd = $key; } $this->handlelinkL1Links($value); } return $linkToAdd; } No matter how I have defined linkToAdd it is always null. How can I do this without it being global?
×
×
  • 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.