Search Results

Search found 42698 results on 1708 pages for 'php in array'.

Page 124/1708 | < Previous Page | 120 121 122 123 124 125 126 127 128 129 130 131  | Next Page >

  • can php read node of float number? [on hold]

    - by Suriani Salleh
    my node number is 1.2.3.4 $node= 1.2.3.4 when i run my code as shown below, it print error message but when i try assign $node = abc_def it execute the function code my question is can php read 1.2.3.4? if(!get_node_id($node) === false){ //function code .................................. ..............................} else { // error msg }

    Read the article

  • how to reduce 2d array

    - by owca
    I have a 2d array, let's say like this : 2 0 8 9 3 0 -1 20 13 12 17 18 1 2 3 4 2 0 7 9 How to create an array reduced by let's say 2nd row and third column? 2 0 9 13 12 18 1 2 4 2 0 9

    Read the article

  • create parent child array from inline data in php

    - by abhie
    actually i have simple problem but i forget how to solve it.. :D i have data on table with following format 01 Johson 01 Craig 01 Johson 02 Daniel 01 Johson 03 Abbey 02 Dawson 01 Brown 02 Dawson 02 Agust 03 Brick 01 Chev 03 Brick 01 Flinch so i want it to become an array like this 01 Johson => 01 Craig ``````````````02 Daniel ```````````````03 Abey ` etc... how to iterate trough the data and make it array like that... i'm newby in PHP :))

    Read the article

  • How to get an Array in jQuery with multiple-input (same input id)

    - by x4tje
    Hello, I've a form where you're able to add more input fields with jQuery. <input type="text" id="task" name="task[]" /> I get an array when i print it with php after submitting the form. I want to handle this with the $.ajax() but i've no idea how i can turn up my <input type="text" id="task" name="task[]" /> in an array in jQuery. Thanks in advance, Firdaus

    Read the article

  • Python: Create a duplicate of an array

    - by Dan
    I have an double array alist[1][1]=-1 alist2=[] for x in xrange(10): alist2.append(alist[x]) alist2[1][1]=15 print alist[1][1] and I get 15. Clearly I'm passing a pointer rather than an actual variable... Is there an easy way to make a seperate double array (no shared pointers) without having to do a double for loop? Thanks, Dan

    Read the article

  • Objective-C Array/List Question

    - by Dave C
    What is the best practice, even in general programming, when you have an undefined, possibly infinite, amount of items that you need in an array but don't have defined bounds. Can you define an endless array in objective c that you can keep pushing items onto, like other lanaguages have a list item. Thanks for any help.

    Read the article

  • encrypt array in php

    - by Jin Yong
    Does anyone know do there have any way that I can encrypt the array in php?? for example: $arr_value = array("1","2","3","4"); any way that I can encrypt $arr_value, also decrypt it later ini php?

    Read the article

  • PHP Change Array Keys

    - by Ice
    Array(0= blabla 1 = blabla 2 = blblll) etc.. Is there a way to change all the numeric keys to "Name" without looping through the array (so a php function)?

    Read the article

  • Flex: changing value in an array where elements are objects

    - by Treby
    Example: var arr_1:Array = new Array(); arr_1.push({sdate:"2010-02-02",status:"New"}); arr_1.push({sdate:"2010-02-03",status:"New"}); arr_1.push({sdate:"2010-02-04",status:"New"}); arr_1.push({sdate:"2010-02-05",status:"New"}); How can i change element number 3 status to: "Old", without removing it. just update the status value??

    Read the article

  • C Programming: malloc() for a 2D array (using pointer-to-pointer)

    - by vikramtheone
    Hi Guys, yesterday I had posted a question: How should I pass a pointer to a function and allocate memory for the passed pointer from inside the called function? From the answers I got, I was able to understand what mistake I was doing. I'm facing a new problem now, can anyone help out with this? I want to dynamically allocate a 2D array, so I'm passing a Pointer-to-Pointer from my main() to another function called alloc_2D_pixels(...), where I use malloc(...) and for(...) loop to allocate memory for the 2D array. Well, after returning from the alloc_2D_pixels(...) function, the pointer-to-pointer still remains NULL, so naturally, when I try accessing or try to free(...) the Pointer-to-Pointer, the program hangs. Can anyone suggest me what mistakes I'm doing here? Help!!! Vikram SOURCE: main() { unsigned char **ptr; unsigned int rows, cols; if(alloc_2D_pixels(&ptr, rows, cols)==ERROR) // Satisfies this condition printf("Memory for the 2D array not allocated"); // NO ERROR is returned if(ptr == NULL) // ptr is NULL so no memory was allocated printf("Yes its NULL!"); // Because ptr is NULL, with any of these 3 statements below the program HANGS ptr[0][0] = 10; printf("Element: %d",ptr[0][0]); free_2D_alloc(&ptr); } signed char alloc_2D_pixels(unsigned char ***memory, unsigned int rows, unsigned int cols) { signed char status = NO_ERROR; memory = malloc(rows * sizeof(unsigned char** )); if(memory == NULL) { status = ERROR; printf("ERROR: Memory allocation failed!"); } else { int i; for(i = 0; i< cols; i++) { memory[i] = malloc(cols * sizeof(unsigned char)); if(memory[i]==NULL) { status = ERROR; printf("ERROR: Memory allocation failed!"); } } } // Inserted the statements below for debug purpose only memory[0][0] = (unsigned char)10; // I'm able to access the array from printf("\nElement %d",memory[0][0]); // here with no problems return status; } void free_2D_pixels(unsigned char ***ptr, unsigned int rows) { int i; for(i = 0; i < rows; i++) { free(ptr[i]); } free(ptr); }

    Read the article

  • Deleting first item of a $_COOKIE array

    - by Mike Burke
    if I add an item to the $_COOKIE array as such: setcookie("favorites[]", "value", time()+3600); I can delete any item from the $_COOKIE[favorites] array like this: setcookie("favorites[$deletekey]", "", time()+3600); EXCEPT the first one added so this does not work: setcookie("favorites[0]", "", time()+3600*24); How can I delete the first one and leave others intact?

    Read the article

  • Fastest way to check array items existence in mySQL table

    - by Enrique
    User writes a series of tags (, separated) and posts the form. I build an array containing the tags and delete dupes with array_unique() php function. I'm thinking of doing: go through the array with foreach($newarray as $item) { ... } check each $item for existence in the tags mySQL table if item does not exists, insert into tags table Is there a FASTER or MORE OPTIMUM way for doing this?

    Read the article

  • using an array in a custom formula in crystal reports xi

    - by Kim Sharpe
    I have a formula which is working; the formula uses an array. I tried to extract the formula to create a custom formula but now get an error in the syntax. I am wondering if the array is causing the problem as the error is on the line: last_element_current:=val(sc_array[1]) + 1; and the error is: the ) is missing and highlights the variable sc_array before the index [1].

    Read the article

  • Doctrine: String keys with Array hydration

    - by BenV
    According to their documentation, you should use Array hydration rather than record hydration when retrieving data for read-only purposes. However, this means I have to access the attributes of the retrieved object using arrays and string keys: $user['Phonenumbers'][0]['number'] instead of the OO style: $user->PhoneNumbers[0]->number Now I'm kinda new to PHP, but in other languages I've worked with the 2nd notation would be preferable because typos would be caught at compile time while typos in string literals would not be noticed until runtime. Does this apply to PHP/Doctrine?

    Read the article

  • need to store values from foreach loop into array

    - by Brad
    Need to store values from foreach loop into an array, need help doing that. Code below does not work, only stores the last value, tried $items .= ..., but that is not doing the trick either, any help will be appreciated. <?php foreach($group_membership as $i => $username) { $items = array($username); } print_r($items); ?>

    Read the article

  • php curly braces into array

    - by David
    Hi, I would like to check a opened .txt file for braces that open and close like below: file { nextopen { //content } } no this is not my own language or anything, but I want to get say the nextopen function and all the contents inside the brackets, and all the stuff from inside the file function and add it to an array if you know what i mean. so all the content inside the braces will be in an array. if you know how to do this please reply.

    Read the article

  • Array split by range?

    - by acidzombie24
    I have an array, i don't know the length but i do know it will be =48bytes. The first 48bytes are the header and i need to split the header into two. Whats the easiest way? I am hoping something as simple as header.split(32); would work ([0] is 32 bytes [1] being 16 assuming header is an array of 48bytes) using .NET

    Read the article

  • How to pass array element one by one in text box in php

    - by trainee
    i am Reading the file contents and passed it in explod function("=",$string) ,it gives me two array parts[0].parts[1] seprated by = .parts[1] array displays all the values of the variable .now how can i use these values one by one to pass in the text box .The variable value comes in this way (value1 value2 value3 value4...) my code also throws the undefined offset :1 notice when i prints the parts[1]arrray

    Read the article

  • Fulltext searching array of strings

    - by Gotys
    I have a PHP array of strings: ie: "Big green car parked outside"..etc I would like to perform boolean search operations on these strings, similar to MySQL fulltext searching , or Sphinx Searching. For example, I would like to find all strings containing word "green" but not "car" Does anyone know of any existing PHP classes or libraries which would help me accomplish this ? Or can anyone suggest any google terms I could search for ? Thank you in advance!

    Read the article

< Previous Page | 120 121 122 123 124 125 126 127 128 129 130 131  | Next Page >