0
votes
0answers
11 views

Default input value being set to “Array” after attempting to pull value from database

Some background: Recently I began messing around with creating a theme options panel in wordpress using 'Options Framework.' One of the options allows typography to be added to the selection of ...
-1
votes
2answers
19 views

Why I am not able to print single value from array which is retrieved form query?

This is my code :- $query=db_query("SELECT node.nid AS nid, term_data.tid AS term_data_tid, node.type AS node_type, node.vid AS node_vid, node.title AS node_title, ...
0
votes
2answers
35 views

Count the number of occurences of a particular value inside loop

In array count all true where category is 1 after counting the category will move to 2 thn count all true and so on? Array generated: foreach($_POST as $key => $data) { $a = explode("_", ...
0
votes
2answers
57 views

How to use a loop variable outside the loop?

I am trying to use $description variable outside the loop. Help me do it please. <?php $sql_album = "SELECT * FROM albums"; $res_album = mysql_query($sql_album) or die(mysql_error()); $albums = ...
0
votes
1answer
26 views

Parsing CSV file in PHP - Function returning undefined variable

I am trying to retrieve certain elements from a csv file to insert into our client reporting database. I'm trying to write a function that will parse the data and return the necessary information. ...
-1
votes
0answers
21 views

isolate a javascript array value and set as a PHP variable

After selecting a company from a select box an Ajax call is used to return an array containing information about that company from the PHP file, using: PHP FILE: echo json_encode($NameReturn); ...
-1
votes
3answers
26 views

if value in end($array) contains something to to second last

I have a array with multiple elememts. I use end($array) to get the last element in the array. But if the last element contains a value it must take the second last element. But if the second last ...
0
votes
2answers
38 views

alternative to eval('$array_test = array('.$test.');')

I'm looking for an alternative to $test = "1=>'msg_test1',3=>'msg_test2',9=>'msg_test3'"; eval('$array_test = array('.$test.');'); does anyone have an idea how i can make it to have an ...
1
vote
1answer
21 views

Heredoc syntax pushing values into arrays

I get a syntax error when I use heredoc syntax to push values into array $theArray = array(); $theArray[] = <<<EOT some values here EOT; $theArray[] = <<<EOT some values here EOT; ...
0
votes
3answers
57 views

PHP, array iteration

i have this array structure: $ar = [product_info] => Array ( [pname] => Array ( [0] => Выделенный ...
2
votes
2answers
42 views

Comparing arrays giving different results

I have the following PHP code: $a = "5"; $b = array("position"=>1); var_dump("5" <= $b); var_dump("5" <= "Array"); var_dump("Z" <= $b); var_dump("Z" <= "Array"); the result is: ...
0
votes
1answer
18 views

cakephp model saveAssociated error - Cannot use string offset as an array

I have a pear shaped one here. It's driven me nuts and have spent a good part of a day on it. I am hoping someone can have a quick skim through this and point out the obvious. I've almost completed ...
1
vote
0answers
29 views

Convert php code to objectiveC

Hi I've this php code: $proxy = new SoapClient('http://magentohost/api/soap/?wsdl'); $sessionId = $proxy->login('apiUser', 'apiKey'); $quoteId = $proxy->call( $sessionId, 'cart.create'); ...
2
votes
2answers
19 views

How do I copy an ArrayIterator to preserve it's current iteration position?

Because this seems like what I have to do to get this effect: $arr = ['a'=>'first', 'b'=>'second', ...]; $iter = new ArrayIterator( $arr ); // Do a bunch of iterations... $iter->next(); // ...
0
votes
3answers
28 views

php array accessing data

this is a part of the array : Array ( [0] => Array ( [account_id] => 104318839768212 [id] => act_104318839768212 [adcampaigns] => Array ...
-1
votes
1answer
60 views

PHP combine array [on hold]

i have an array: $ar = array( 0 => array('id' => '1', 'pname' => 'text'), 1 => array('id' => '2', 'pname' => 'text2'), 2 => array('id' => '2', 'pname' => 'text3'), 3 ...
0
votes
1answer
27 views

Create multidimensional sub array from existing array values

I've been racking my head on this one and am hoping someone has a creative solution for this. In short, we are pulling info from a database and would like to create a nested array using some of the ...
-4
votes
1answer
40 views

How to get sub array values from multidimentional in PHP ? [on hold]

I have a multi-dimentional array like this: $x[25]['time'] = array(1,2,3,4,5); Basically how to get directly subarray values when key (ex. 25) is changing. I don't want to use foreach($x as $t) ...
0
votes
5answers
39 views

merge two associative arrays add titles

I have two arrays $Array_1 = array( 'ID_1' => 'Michael', 'ID_2' => 'Jerry', 'ID_3' => 'Tony', 'ID_4' => 'Roger', ); $Array_2 = array( 'ID_1' => 'Chef', ...
0
votes
1answer
17 views

convert results from for-loop array to a new array

I have the following code that gets Channel and AP Count values from XML test.xml. I need to create a PHP Jpgraph based on these results. Therefore, I will need to store for-loop results for ...
-1
votes
1answer
29 views

Search and compare an array using PHP?

Just need a little help here about arrays. I need to compare the array ID in the database result. If existed in the array. The database result will be overwritten based on the corresponding ID of the ...
1
vote
1answer
13 views

using array_intersect_key on a single array

I have an array which looks like this: Array ( [0] => Array ( [Binding] => Video Game [Brand] => Sony [Color] => Crystal black ...
0
votes
2answers
31 views

PHP Compare 2 Arrays - array to string conversion error

foreach($this->galleryPhotoDBInitialArray as $initialArrayElement) { $photoExists = false; foreach($this->galleryPhotoDBFinalArray as $finalArrayElement) { ...
0
votes
1answer
32 views

How to insert a value in an array if the index value is not existed using PHP?

Can you help me with my problem? I have a problem in array. To make my problem short here it is. I created a code that can automatically replace and add a value in an array using an onclick. But ...
0
votes
3answers
38 views

How can I replace a certain part of array using PHP?

Just need a little help here about arrays. Because I am trying to create a code that when you click it it will replace a certain array values. In the base array suppose that we have this array: ...
2
votes
4answers
40 views

While loop in foreach resulting in blank page

I really can't figure out this one! I'm trying to show data from a database in the following fashion: A FOREACH loop that loops through an array ($jaren) of 12 values. (users can pick one of these ...
0
votes
1answer
27 views

Find the parent key in array during recursive iteration

Consider an array structure like this [DVTTISEGA] => Array ( [attr] => Array ( [DepartureDateTime] => 2014-03-17T06:15:00 ...
0
votes
1answer
33 views

How to get array from input and select box with jquery?

I'm learning js and jquery. I will post values as array with jquery ajax and in php code I will use it with foreach loop. <select name="passenger['+i+'][nationality]"> <option ...
-1
votes
2answers
38 views

PHP search inside array [on hold]

Array ( [1] => Array ( [A] => Rina [B] => Reding [C] => 9987536263 [D] => 47 [E] => NO ) [2] => Array ( [A] => Anna [B] => Jones [C] => 0243055454 [D] ...
0
votes
1answer
18 views

Codeigniter Array in GET variable Clean URL

I would like to ask if there is any option how to change URL with Array in GET to CLEAN. Example: From this: example.com/school/4/?city[]=1&city[]=2&city[]=3 I need this: ...
0
votes
4answers
25 views

How do I display all the values of a multi dimentional array?

Hey I have an array that contains an array: $outPutResults = array(); while($row = mysqli_fetch_array($results)) { $outPutResults[] = $row['industry']; ...
-10
votes
0answers
37 views

How to loop and print this object array? [on hold]

This is Doctrine2 query result i want to echo 'stuFname' in this array Array ( [0] => Array ( [0] => SchoolAdmin\Entity\Classtudent Object ( [csID:protected] => 43 [csClassID:protected] => 14 ...
1
vote
3answers
41 views

Convert a string to an array in PHP

I have an array like such: array('some_key' => 'some_value'); I would like to take that and transform it to, this should be done programatically array('some_key' => array('some_value')); ...
-1
votes
1answer
36 views

PHP Array to JSON Array

I have the following PHP array: array(3) { ["NDQ"]=> array(2) { [0]=> string(6) "Google" [1]=> string(5) "Yahoo" } ["NYSE"]=> array(2) { [0]=> ...
-3
votes
1answer
25 views

unique combination of three numbers [on hold]

In PHP how to code like the following, I need it in three numbers in each row like let say, If I have array of 1,2,3,4 then I need combination of following with unique values, 1,2,3 1,2,4 2,3,4 ...
0
votes
4answers
28 views

how do I look an array to extract data

Hi all Im trying to query a database and store the results ($searchResults[]) as an array : <?php if(isset($_POST['indexSearchSubmit'])) { foreach($_POST['industryList'] as $selected) { ...
1
vote
1answer
25 views

“Indirect modification of overloaded element of SplFixedArray has no effect”

Why the following $a = new SplFixedArray(5); $a[0] = array(1, 2, 3); $a[0][0] = 12345; // here var_dump($a); produces Notice: Indirect modification of overloaded element of SplFixedArray has no ...
0
votes
1answer
19 views

Joomla 3.0 JFactory::getApplication() get always returns null

I'm trying the extract the array data from a nested array (shown is part of a var_dump): ["passcodes"]=> array(2) { [0]=> array(1) { [0]=> string(33) ...
0
votes
1answer
20 views

build link using postgresql and php

) I have a question: I have a databse with the following information: Name of report [name] Link to report [link] The various reports are displayed in tables in my page (using db_tables filed with ...
0
votes
2answers
40 views

get first and last element in array

hey there i have this array: array(1) { ["dump"]=> string(38) "["24.0",24.1,24.2,24.3,24.4,24.5,24.6]" } my question: how to get the first and the last element out from this array, so i ...
0
votes
2answers
26 views

PHP, can't use xml array (simplexml)

I have an rss in xml form with who contain (well formatted) $xml = simplexml_load_file("/rss.xml"); echo $xml->item[0]->guid; This code give me nothing. If I var_dump the $xml, I get 40 ...
0
votes
1answer
43 views

Loop logic help needed - Can't compare correctly

I have the following table: And I use this function to get data from it: function get_cart_by($player_id) { global $db; $sql = 'SELECT DISTINCT(item_id) FROM ' . PCP_MARKET_CART . ' ...
0
votes
2answers
50 views

Jquery to PHP array transfer

Ok, I know there were many of those but my code just won't work... I tried solutions found on Stack but still... I would like to transfer my array built in jQuery to my php script that will compare ...
0
votes
1answer
22 views

PHP Parsing xml output into array

in my project i need a function that create an xml output from alexa data and parse entire result into an array. I have start by first node like this: <?php $url="samsung.com"; $xml = ...
0
votes
1answer
38 views

Laravel: How to select images from an array

New to Laravel and can't seem to solve this otherwise trivial issue. Working with someone else's code here. They've defined the array "assets" in which 4 images are being pulled: ...
1
vote
1answer
25 views

preg_replace remove linebreak between custom tags

So if a user enters [tag]hello[/tag] then it works great. However, if a user enters: [tag]Hello How are you[/tag] with a line break in the form, the content between the [tag] [/tag] dose not get ...
2
votes
1answer
56 views

Create multidimensional array from standard array

Most likely I'm doing this wayyyyyy too complicated. But I'm in the need of converting multiple arrays to multidimensional array key's. So arrays like this: Array //$original ( [0] => 500034 ...
0
votes
0answers
6 views

PHP soap array construction to match the soap request

I have the wsdl description like this: <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" ...
1
vote
2answers
50 views

Combine 2 array rows (sum 2 values)

I have this array: array( array('id' => 1, 'price' => 20.00, 'stock' => 2, 'year' => 11 ), array('id' => 1, 'price' => 20.00, 'stock' => 3, 'year' => 12 ), ...
1
vote
1answer
45 views

are php references a good idea when handling large or many arrays?

Finally I have something to ask the community My case: I have some box-like objects with internal arrays, I wish to manipulate these arrays inside methods, but a donating box must result empty after ...

15 30 50 per page