Search Results

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

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

  • Three 1D Arrays to One 2D Array

    - by Steven
    I have a function which accepts a 2D array, but my data is in three 1D arrays. How do I create a 2D array consisting of the three arrays to pass to the subroutine? Dim Y0(32) As Double Dim Y1(32) As Double Dim Y2(32) As Double 'Code to fill arrays' 'Attempting to call:' Sub PlotYMult(YData(,) as Double)

    Read the article

  • Matlab - building an array while looping

    - by Mark
    Hello, I have a for loop that loops over one array... for i=1:length(myArray) In this loop, I want to do check on the value of myArray and add it to another array myArray2 if it meets certain conditions. I looked through the Matlab docs, but couldn't find anything on creating arrays without declaring all their values on initialization or reading data into them in one shot. Many thanks!

    Read the article

  • Write a foreach loop for this array.

    - by mjames
    Hi, I am using the xpath in php5 to parse a xml document. The problem I have is writing a foreach to correctly display the following array array(1) { [0]= object(SimpleXMLElement)#21 (2) { ["file"]= string(12) "value 1" ["folder"]= string(8) "value 2" } } Ideally i would like to get the value by using $row['file'] or $row['folder']. Thanks for any help.

    Read the article

  • Loop through Javascript array, print with string.

    - by Adam
    I have a simple array like: var myArr=["one","two","three"]; an I have a counting loop, which increases the value of var "i" by one. What I want to do is print the next value from the array each time the loop runs, next to a text string, like so: alert('value number '+myArr[i]+); But for some reason I can't get this to work. The following code works, so I'm assuming I'm not calling the counter right: alert('value number '+myArr[0]+);

    Read the article

  • give preference to print array values in php

    - by Bharanikumar
    Hi , I have country table, i fetch all values and moved into array , these value i like to populate into combo/dropdown list , here i want to do some magic things, that is , for my site most of the users coming from uk,us,Australia,Romain and few, So i like to populate by my preference , is there any array will do this magic work, else is it possible mysql query , So final question is , Populate country name into combo based on my prefernce , Thanks

    Read the article

  • PHP array question.

    - by TaG
    How do I show the dates number format next to its name in the array using PHP? So that the number format is saved in the database and the month name is displayed? Here is the php code. $month_options = array("Month", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");

    Read the article

  • [C#] Get Index of Control in an Control-Array

    - by Cocaine112358
    I have a TextBox Array private TextBox[,] Fields = new TextBox[9, 9]; and all the TextBoxes have got the same TextChanged-Event void Field_Changed( object sender, EventArgs e ) Is there a way to get the Index of the sender in the Array (without giving each TextBox it's own EventHandler)?

    Read the article

  • PHP array performance

    - by dfo
    Hi, this is my first question on Stackoverflow, please bear with me. I'm testing an algorithm for 2d bin packing and I've chosen PHP to mock it up as it's my bread-and-butter language nowadays. As you can see on http://themworks.com/pack_v0.2/oopack.php?ol=1 it works pretty well, but you need to wait around 10-20 seconds for 100 rectangles to pack. For some hard to handle sets it would hit the php's 30s runtime limit. I did some profiling and it shows that most of the time my script goes through different parts of a small 2d array with 0's and 1's in it. It either checks if certain cell equals to 0/1 or sets it to 0/1. It can do such operations million times and each times it takes few microseconds. I guess I could use an array of booleans in a statically typed language and things would be faster. Or even make an array of 1 bit values. I'm thinking of converting the whole thing to some compiled language. Is PHP just not good for it? If I do need to convert it to let's say C++, how good are the automatic converters? My script is just a lot of for loops with basic arrays and objects manipulations. Thank you! Edit. This function gets called more than any other. It reads few properties of a very simple object, and goes through a very small part of a smallish array to check if there's any element not equal to 0. function fits($bin, $file, $x, $y) { $flag = true; $xw = $x + $file->get_width();; $yh = $y + $file->get_height(); for ($i = $x; $i < $xw; $i++) { for ($j = $y; $j < $yh; $j++) { if ($bin[$i][$j] !== 0) { $flag = false; break; } } if (!$flag) break; } return $flag; }

    Read the article

  • Loop through array, print with string.

    - by Adam
    I have a simple array like: var myArr=["one","two","three"]; an I have a counting loop, which increases the value of var i by one. What I want to do is print the next value from the array each time the loop runs, next to a text string, like so: alert('value number '+myArr[i]+); But for some reason I can't get this to work. The following code works, so I'm assuming I'm not calling the counter right: alert('value number '+myArr[0]+);

    Read the article

  • PHP number range menu from array

    - by Julious
    Hello people! I'm a bit confused here. I have a php array like this Array(2010,2009,2008 ...1992) and i want to create a loop to print a menu with a four year range counting down like this 2010-2006 2005-2001 2000-1996 etc.. How can i do this Everything i tried end up in an endless loop. THnx in advance. J.

    Read the article

  • Adding to an Array

    - by j-t-s
    Hi All I have an array: String[] ay = { "blah", "blah number 2" "etc" }; ... But now I want to add to this array at a later time, but I see no option to do so. How can this be done? I keep getting a message saying that the String cannot be converted to String[]. Thank you

    Read the article

  • Sending emails from PHP - email providers vs GAE

    - by nrph
    I need to send emails from my social service (this is continuation of Experiences in mailing to registered users). I got strong feeling that it's better to avoid problems with email server configuration and maintance and to choose email provider which will take care of all painful problems. So several offers were compared: http://imgur.com/JkK2X.jpg Three of them look very attractive: Postageapp / Sendgrid / CritSend As alternative i'm considering setup GAE app. Email provider is quite easy to start work with, but have no idea how much effort require GAE to integrate with PHP. So my question is: which option is better to choose: email provider GAE ? Two factors are important here: business background (therefore prices are mentioned), work required to setup and maintain desired solution. Preferably i would love to avoid all email-related problems (like black lists and so on).

    Read the article

  • Upgrading PHP on MacOSX without config_vars.mk ?

    - by Ken
    Hi everyone, I want to upgrade my php version running on MAMP to 5.3. I've copied the ./configure statement from phpinfo() and downloaded the 5.3 branch source i wish to compile. However, when i try to compile it i get an error about a missing config_vars.mk file from apxs. How can i solve this issue if i do not have the config_vars.mk? can one be deprecated? can i copy the one from the stock apache that comes installed on OS X (SL)? What will happen if i remove --with-apxs from the configure line? Thanks in advance for any help. It is greatly appreciated. Ken.

    Read the article

  • How do I enable JPEG Support for PHP?

    - by ngache
    My Configure Command doesn't say anything about jpg, nor gif/png, but I can see gif/png support in the output of phpinfo(). I built PHP with --with-gd, but only GIF Support and PNG Support are in the output of phpinfo(), how do I enable JPEG Support? UPDATE I got this problem when compiling : Sorry, I cannot run apxs. Possible reasons follow: 1. Perl is not installed 2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs 3. Apache was not built using --enable-so (the apxs usage page is displayed) The output of /usr/local/apache2/bin/apxs follows: cannot open /usr/local/apache2/build/config_vars.mk: No such file or directory at /usr/local/apache2/bin/apxs line 218. What should I do now?

    Read the article

  • Compiling PHP 5.3.3 on Ubuntu 8.04: Could not find libevent

    - by Nick
    When attempting to ./configure PHP 5.3.3 on Ubuntu 8.04, I get the error: checking for libevent >= 1.4.11 install prefix... configure: error: Could not find libevent >= 1.4.11 in /usr/local/ I tried installing the libevent-dev and libevent1 packages, but same error. I then removed the packages, downloaded and compiled libevent from source. Same error. Locate shows that libevent was installed to /usr/local/lib/libevent.so with all its friends in /usr/local/lib/. I tried configuring with the option: --with-libevent-dir=/usr/local/lib/ Basically the same error: checking for libevent >= 1.4.11 install prefix... configure: error: Could not find libevent >= 1.4.11 in /usr/local/lib/ Any suggestions??

    Read the article

  • Python server does not excecute PHP script: permission denied

    - by krisvandenbergh
    I am trying to execute a PHP file through a Python server. However, I get the following error: File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/CGIHTTPServer.py", line 255, in run_cgi os.execve(scriptfile, args, os.environ) OSError: [Errno 13] Permission denied The python server is running though. What have I done so far? Chmod'ed recursively all directories to (chmod -R a+x) (I know this is not secure but its just for testing purposes) for both Python installation directories and my scripts. Tried to find out if python server is running as root through ps aux grep py I am out of ideas. What could be going wrong else? Thanks for the feedback.

    Read the article

  • Problem to connect to MySQL server (error #2002) in PHP

    - by Martin
    I installed ZWAMP 1.0.7 (on Windows 7), but I'm having a weird problem. I can't connect to my MySQL server from any PHP script. If I try to use MySQL command line everything works fine but PHPMyAdmin retruns error #2002. I'm not sure whether it's important or not but MySQL server is not able to create socket file. I don't know what's the problem but I think everything is configured in my.cnf properly. Do you have any ideas?

    Read the article

  • PHP-APC is exceeding limit apc.shm_size often

    - by user142741
    I am implementing the apc on a shared server that currently has 1000 sites (using wordpress, moodle, etc.). I'm Looking for the admin page, and I see "Cache full count" is growing rapidly. I've tried increasing the value of "apc.shm_size" reduce value "apc.ttl" increase the value "apc.shm_segments" but I can not resolve this issue. What am I doing wrong? I'm putting down some information: apc.ini: extension=apc.so apc.shm_size = 256 apc.enabled = 1 apc.ttl = 300 apc.user_ttl = 300 Ubuntu: 12.04 PHP: 5.3.10 APC: 3.1.7 Server has 16GB memory Limit share memory: 256MB

    Read the article

  • Problem to connect to MySQL server (error #2002) in PHP

    - by user41514
    Hello, I installed ZWAMP 1.0.7 (on Windows 7), but I'm having a weird problem. I can't connect to my MySQL server from any PHP script. If I try to use MySQL command line everything works fine but PHPMyAdmin retruns error #2002. I'm not sure whether it's important or not but MySQL server is not able to create socket file. I don't know what's the problem but I think everything is configured in my.cnf properly. Do you have any ideas?

    Read the article

  • how to limit disk space per user in a PHP web application & CentOS

    - by solid
    we have a web application written in PHP and we want all our users to be able to upload images for e.g. 50MB. We will create a directory structure so that every user has its own folder like app/user1/images app/user2/images ... Now everytime a user uploads an image, we need to check if this is still allowed or not but we don't want 1000 users to continously scan our hard drive counting file sizes in their directory. So writing a script that counts all file sizes in a user directory is not an option I guess? Is there an easier way to calculate used up space per user and limit our app accordingly?

    Read the article

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