Search Results

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

Page 148/1708 | < Previous Page | 144 145 146 147 148 149 150 151 152 153 154 155  | Next Page >

  • python array.array with strings as data type

    - by Gladius
    Is there an object that acts like array.array, yet can handle strings (or character arrays) as its data type? It should be able to convert the string array to binary and back again, preferably with null terminated strings, however fixed length strings would be acceptable. >>> my_array = stringarray(['foo', 'bar']) >>> my_array.tostring() 'foo\0bar\0' >>> re_read = stringarray('foo\0bar\0') >>> re_read[:] ['foo', 'bar'] I will be using it with arrays that contain a couple million strings.

    Read the article

  • HTTP Requests Fails for WordPress sites after upgrading from PHP 5.2 to PHP 5.3

    - by anjanesh
    I've upgraded from Ubuntu 9.10 to 10.04 beta 1 and PHP got upgraded from 5.2 to 5.3 Now all my WordPress & Magento sites arent working. I tried retrieving the URL headers from the command line, but HTTP request fails. Utilizing get_headers in a small script, PHP Warning: get_headers(http://local.vhosts1.com): failed to open stream: HTTP request failed! in get_headers.php on line 12 But HTTP request fails only for WordPress and Magento based sites - not custom written ones. Does this probably have to do with some htaccess directive ?

    Read the article

  • FTP Upload works from local command line / remote GUI client but not from PHP script

    - by MrOodles
    I originally posted this question at StackOverflow, but I'm beginning to think it's more of a server question. I have installed ProFTPd on an EC2 instance running Ubuntu 10.10. I have managed my proftpd.conf file as well as my server permissions to be able to connect and upload/move files using FTP both remotely using Filezilla, and on the server itself when connecting to 127.0.0.1. The problem I'm running into is when I try to upload/install a file using Joomla's interface. I give Joomla the same login information that I give to Filezilla, and the connection is made in the same fashion. The ftp.log file actually shows that Joomla is able to login to the server: localhost UNKNOWN nobody [17/Jan/2011:14:09:17 +0000] "USER ftpuser" 331 - localhost UNKNOWN ftpuser [17/Jan/2011:14:09:17 +0000] "PASS (hidden)" 230 - localhost UNKNOWN ftpuser [17/Jan/2011:14:09:17 +0000] "PASV" 227 - localhost UNKNOWN ftpuser [17/Jan/2011:14:09:17 +0000] "TYPE I" 200 - localhost UNKNOWN ftpuser [17/Jan/2011:14:09:17 +0000] "STOR /directory/store/location/file.zip" 550 - But it fails when attempting the STOR command. I have traced the problem in the Joomla code to the PHP FTP module. The code (with my trace statements added): if (@ftp_put($this->_conn, $remote, $local, $mode) === false) { echo "\n FTP PUT failed."; echo "\n Remote: $remote ; Local: $local ; Mode: $mode - Either ASCII: ".FTP_ASCII." or Binary: ".FTP_BINARY; echo "\n The user: ".exec("whoami"); JError::raiseWarning('35', 'JFTP::store: Bad response' ); return false; } Trace ouputs: FTP PUT failed. Remote: /directory/store/location/file.zip ; Local: /tmp/phpwuccp4 ; Mode: 2 - Either ASCII: 1 or Binary: 2 The user: www-data And in case you were curious, here is an example of the FTP log when using Filezilla: my_client_ip UNKNOWN nobody [17/Jan/2011:16:45:55 +0000] "USER ftpuser" 331 - my_client_ip UNKNOWN ftpuser [17/Jan/2011:16:45:55 +0000] "PASS (hidden)" 230 - my_client_ip UNKNOWN ftpuser [17/Jan/2011:16:45:55 +0000] "OPTS UTF8 ON" - - my_client_ip UNKNOWN ftpuser [17/Jan/2011:16:45:55 +0000] "PWD" 257 - my_client_ip UNKNOWN ftpuser [17/Jan/2011:16:45:55 +0000] "TYPE I" 200 - my_client_ip UNKNOWN ftpuser [17/Jan/2011:16:45:55 +0000] "PASV" 227 - my_client_ip UNKNOWN ftpuser [17/Jan/2011:16:45:55 +0000] "MLSD" 226 3405 my_client_ip UNKNOWN ftpuser [17/Jan/2011:16:46:06 +0000] "CWD location" 250 3405 my_client_ip UNKNOWN ftpuser [17/Jan/2011:16:46:06 +0000] "PWD" 257 3405 my_client_ip UNKNOWN ftpuser [17/Jan/2011:16:46:06 +0000] "PASV" 227 3405 my_client_ip UNKNOWN ftpuser [17/Jan/2011:16:46:07 +0000] "MLSD" 226 3757 my_client_ip UNKNOWN nobody [17/Jan/2011:16:46:37 +0000] "USER ftpuser" 331 - my_client_ip UNKNOWN ftpuser [17/Jan/2011:16:46:37 +0000] "PASS (hidden)" 230 - my_client_ip UNKNOWN ftpuser [17/Jan/2011:16:46:37 +0000] "OPTS UTF8 ON" - - my_client_ip UNKNOWN ftpuser [17/Jan/2011:16:46:37 +0000] "CWD /location" 250 - my_client_ip UNKNOWN ftpuser [17/Jan/2011:16:46:37 +0000] "PWD" 257 - my_client_ip UNKNOWN ftpuser [17/Jan/2011:16:46:37 +0000] "TYPE I" 200 - my_client_ip UNKNOWN ftpuser [17/Jan/2011:16:46:37 +0000] "PASV" 227 - my_client_ip UNKNOWN ftpuser [17/Jan/2011:16:46:39 +0000] "STOR file.zip" 226 125317 my_client_ip UNKNOWN ftpuser [17/Jan/2011:16:46:39 +0000] "PASV" 227 - my_client_ip UNKNOWN ftpuser [17/Jan/2011:16:46:39 +0000] "MLSD" 226 497

    Read the article

  • Online editing gettext files?

    - by NeoNmaN
    Online editing gettext files, is it possible? I use gettext for all my PHP projects, but sides with a minor problem, want to mine user may translate my language from as Danish to Norwegian, but in this case it enste I know is that I need to export my file from Poedit there is any. other software that can export / import my files? for Poedit can I do with export as. hope i could help me a little.

    Read the article

  • Clone of olx.com

    - by Sarfraz
    Hello, I just wanted to know if anyone knows about the clone of http://www.olx.com made in PHP. Note: Not sure whether to ask this question here but I thought only programmers might tell as this is their business. Thanks.

    Read the article

  • Passing Info From One View to Another

    - by 01010011
    EDIT 1. The results of a query from my database are displayed on my view page. Next to each unique result is a button: // first_view.php <?php echo form_open('controller/method'); ?> <?php foreach($results_found as $item): ?> <p><?php echo $item->name ?></p> <p><?php form_submit('buy','Buy This'); ?></p> When a user clicks on one of these buttons (lets say button 4), I would like to display the user's choice from the array onto another view. I've tried using this: // first_view.php <?php echo $this->session->set_userdata('choice',$item); ?> immediately before // first_view.php <?php echo form_close(); ?> thinking that the user's final choice would be stored there so I can display it on another view like this: // second_controller.php $c = $this->session->userdata('choice'); // second_view.php echo 'Your Choose: '. $c; However, what actually displays is the last result displayed on first_view.php, not what the user choose. My question is, if the user clicked on button 4, how do I get that particular choice displayed onto another view? END OF EDIT1 ORIGINAL QUESTION My view page (CodeIgniter) displays the contents of an array in the form of several links. If a user clicks on a link, I want the user to be taken to another view page (via a controller) that gives more information concerning that particular link (which is stored in that particular position in the array) My question is, how do I access and display the contents of that particular location within the array on the second view file without getting a "Undefined variable error" on the second view? Here is what I am trying to do in code form // my_controller.php $array_name['variable_name']; $this->load->view('first_view.php'); // first_view.php <?php foreach($variable_name as $vn): ?> <?php echo anchor('controller_name' $vn->info ?> // if user clicks on 3rd link <?php endforeach ?> // I want to beable to access // index 2 of the array in the // second view file so I can // display more info // second_view.php <?php $vn[2]->info ?>

    Read the article

  • Retrieve contents of a public Dropbox folder?

    - by Sam
    Is there a way to retrieve a list of the contents of a public Dropbox folder (preferably in PHP)? This is what a URL to a public file in Dropbox looks like: http://dl.dropbox.com/u/1234567/publikPholder/textytext.txt One would think that jumping up one level to the directory in the URL... http://dl.dropbox.com/u/1234567/publikPholder/ ...would show all the public files. Nope. Nothing but a 404.

    Read the article

  • mb_internal_encoding() not available though configured?

    - by Jonas Byström
    I'm having problem with mbstring in my Apache2.2/Win7/PHP5.3 setup, though I think it's correctly configured in my php.ini: extension_dir = "ext" extension=php_mbstring.dll I get the following: Fatal error: Call to undefined function mb_internal_encoding() in ... I did a manual installation (by the book) using the VC6 .zip. I'm running out of ideas of what to try.

    Read the article

  • Trouble with arrays

    - by Ockonal
    Hi guys, I have such string in PHP: $data = '1;3;5;7;9'; And cycle: for ($i=0; $i < count($someArray); $i++) { // If $i == any number in $data } What is the faster way to compare $i from cycle with numbers in string. I have to check that cycle-counter is in string.

    Read the article

  • how does array_diff work?

    - by SpawnCxy
    I just wonder how array_diff() works.And obviously it couldn't work as follows function array_diff($arraya, $arrayb) { $diffs = array(); foreach ($arraya as $keya => $valuea) { foreach ($arrayb as $valueb) { if ($valuea == $valueb) { break; } $diffs[$keya]=$valuea; } } return $diffs; } //couldn't be worse than this Hope someone can show me some better solution. Thanks.

    Read the article

  • What PHP configuration and extensions are recommended for speed, efficiency and security?

    - by Sanoj
    I am setting up an Ubuntu server with nginx and PHP. I have read about many different configurations and extensions that could be added and it is pretty hard to know about all of them. I would like to hear from you, sysadmins, what PHP configuration and extensions do you recommend? I have read about: Suhosin for security Alternative PHP Cache for speed and efficiency Memcache for speed and efficiency PHP FastCGI Process Manager for speed and efficiency But I have no idea if they are good or not, and if I should use them together.

    Read the article

  • What PHP configuration and extensions are recommended for efficiency and security?

    - by Sanoj
    I am setting up an Ubuntu VPS server with nginx and PHP. I have read about many different configurations and extensions that could be added and it is pretty hard to know about all of them. I would like to hear from you, sysadmins, what PHP configuration and extensions do you recommend? I have read about: Suhosin for security Alternative PHP Cache for efficiency PHP FastCGI Process Manager for efficiency But I have no idea if they are good or not, and if I should use them together.

    Read the article

  • In plesk 9.3.0, which php.ini is in use?

    - by Gaia
    I have 3 (actually 4, but the 4th one is for installatron) php.ini files in my Virtuozzo Container running RHEL 5.x /vz/root/1003/usr/local/psa/admin/conf/php.ini /vz/root/1003/etc/php.ini /vz/root/1003/etc/etc/php.ini which one do I use to change the MEMORY_LIMIT for a wordpress app running in the container 1003? Thanks!

    Read the article

  • How can I add color highlighting for PHP functions?

    - by Jeff Gortmaker
    I've recently begun using Notepad++, and have found a part of its styling functionality that confuses me. I'm currently attempting to color all of PHP's defined functions (such as count(), strlen(), etc.). In the Settings-Style Configurator, you cannot add a new style for such a function list. Instead, I have begun editing the stylers.xml and langs.xml. To add the new coloring, in langs.xml, I've modified the php section to the following: <Language name="php" ext="php php3 phtml" commentLine="//" commentStart="/*" commentEnd="*/"> <Keywords name="instre1">[default keywords]</Keywords> <Keywords name="instre2">[my function list]</Keywords> </Language> The [default keywords] and [my function list] are replaced with wordlists. I've also edited the php section in stylers.xml to look like the following: <LexerType name="php" desc="php" ext=""> <WordsStyle name="QUESTION MARK" styleID="18" fgColor="FF0000" bgColor="FDF8E3" fontName="" fontStyle="0" fontSize="" /> <WordsStyle name="DEFAULT" styleID="118" fgColor="000000" bgColor="FEFCF5" fontName="" fontStyle="0" fontSize="" /> <WordsStyle name="STRING" styleID="119" fgColor="FF0000" bgColor="FEFCF5" fontName="" fontStyle="0" fontSize="" /> <WordsStyle name="STRING VARIABLE" styleID="126" fgColor="FF0000" bgColor="FEFCF5" fontName="" fontStyle="1" fontSize="" /> <WordsStyle name="SIMPLESTRING" styleID="120" fgColor="FF0000" bgColor="FEFCF5" fontName="" fontStyle="0" fontSize="" /> <WordsStyle name="WORD" styleID="121" fgColor="008040" bgColor="FEFCF5" fontName="" fontStyle="1" fontSize="" keywordClass="instre1">True False</WordsStyle> <WordsStyle name="NUMBER" styleID="122" fgColor="FF0000" bgColor="FEFCF5" fontName="" fontStyle="0" fontSize="" /> <WordsStyle name="VARIABLE" styleID="123" fgColor="0080FF" bgColor="FEFCF5" fontName="" fontStyle="0" fontSize="" /> <WordsStyle name="COMMENT" styleID="124" fgColor="FF8040" bgColor="FEFCF5" fontName="" fontStyle="0" fontSize="" /> <WordsStyle name="COMMENTLINE" styleID="125" fgColor="FF8040" bgColor="FEFCF5" fontName="" fontStyle="0" fontSize="" /> <WordsStyle name="OPERATOR" styleID="127" fgColor="8000FF" bgColor="FEFCF5" fontName="" fontStyle="0" fontSize="" /> <WordsStyle name="FUNCTIONS" styleID="128" fgColor="000080" bgColor="FEFCF5" fontName="" fontStyle="1" fontSize="" keywordClass="instre2"></WordsStyle> </LexerType> The changed part is the last "FUNCTIONS" line. When I restart Notepad++ and go into the Settings-Style Configurator section, under the php language, the FUNCTIONS style exists. I can change the style's color, and can see the entire keyword list under 'Default Keywords'. However, it is not changing the coloring of the words in my code. When I edit the WORD style, which contains stuff like 'if', 'and', and 'true', things change accordingly in my code. Any ideas on how to make this work?

    Read the article

  • How do I upgrade to PHP 5.4 in CentOS 6.3 with yum?

    - by Vicary
    I found some blog posts about this, but it's rather lack of descriptions on possible side effects. I could really use some detailed on these steps: How to add a repo that provides PHP 5.4 into yum Can this seamlessly replaces the current PHP version in CentOS? How can I switch back to the official repo when it supports PHP 5.4? (current 5.3.3 in my system) Will there be any potential to break PHP modules I currently using?

    Read the article

  • jquery parse json multidimensional array

    - by ChrisMJ
    Ok so i have a json array like this {"forum":[{"id":"1","created":"2010-03-19 ","updated":"2010-03-19 ","user_id":"1","vanity":"gamers","displayname":"gamers","private":"0","description":"All things gaming","count_followers":"62","count_members":"0","count_messages":"5","count_badges":"0","top_badges":"","category_id":"5","logo":"gamers.jpeg","theme_id":"1"}]} I want to use jquery .getJSON to be able to return the values of each of the array values, but im not sure as to how to get access to them. So far i have this jquery code $.get('forums.php', function(json, textStatus) { //optional stuff to do after success alert(textStatus); alert(json); }); If you can help id be very happy :)

    Read the article

  • Rotate two dimensional array 90 degrees clockwise

    - by user69514
    I have a two dimensional array that I need to rotate 90 degrees clockwise, however I keep getting arrayindexoutofbounds... public int[][] rorateArray(int[][] arr){ //first change the dimensions vertical length for horizontal length //and viceversa int[][] newArray = new int[arr[0].length][arr.length]; //invert values 90 degrees clockwise by starting from button of //array to top and from left to right int ii = 0; int jj = 0; for(int i=0; i<arr[0].length; i++){ for(int j=arr.length-1; j>=0; j--){ newArray[ii][jj] = arr[i][j]; jj++; } ii++; } return newArray; }

    Read the article

  • Coldfusion 8: Array of structs to struct of structs

    - by davidosomething
    I've got an array items[] Each item in items[] is a struct. item has keys id, date, value (i.e., item.id, item.date, item.value) I want to use StructSort to sort the item collection by a date Is this the best way to do it in ColdFusion 8: <cfset allStructs = StructNew()> <cfloop array = #items# index = "item"> <cfset allStructs[item.id] = item> <cfset unixtime = DateDiff("s", CreateDate(1970,1,1), item.date)> <cfset allStructs[item.id].unixtime = unixtime> </cfloop> <cfset allStructs = StructSort(allStructs, "numeric", "desc", "unixtime")> It's going to be dreadfully slow

    Read the article

  • Printing entire array in C#

    - by DMan
    I have a simple 2D array: int[,] m = {{0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0} }; How can I print this out onto a text file or something? I want to print the entire array onto a file, not just the contents. For example, I don't want a bunch of zeroes all in a row: I want to see the {{0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0} }; in it.

    Read the article

  • How to decode Google spreadsheet's Json respose as a Php Array

    - by Mohammad
    My google Docs Spreadsheet call returns this response in the json format (I only need everything after "rows") please look at the formatted response here : ) I use php's json_decode function to parse the data and use it (Yes, I am awful at php) This code returns NULL, and according to the documentation, NULL is returned "if the json cannot be decoded". $json = file_get_contents($jsonurl); $json_output = json_decode($json); var_dump ($json_output); // Returns NULL Basically, what i want to accomplish is to make a simple array from the first row values of the Json response. like this $array = {'john','John Handcock','[email protected]','2929292','blanc'} You guys are genius, I would appreciate your insight and help on this very much! Answer as "sberry2A" mentions bellow, the response is not valid Json, google offers the Zend Json library for this purpose, tho I decided to parse the tsv-excel version instead :)

    Read the article

  • Advanced Array Sorting in Ruby

    - by Ruby Beginner
    I'm currently working on a project in ruby, and I hit a wall on how I should proceed. In the project I'm using Dir.glob to search a directory and all of its subdirectories for certain file types and placing them into an arrays. The type of files I'm working with all have the same file name and are differentiated by their extensions. For example, txt_files = Dir.glob("**/*.txt") doc_files = Dir.glob("**/*.doc") rtf_files = Dir.glob("**/*.rtf") Would return something similar to, FILECON.txt ASSORTED.txt FIRST.txt FILECON.doc ASSORTED.doc FIRST.doc FILECON.rtf ASSORTED.rtf FIRST.rtf So, the question I have is how I could break down these arrays efficiently (dealing with thousands of files) and placing all files with the same filename into an array. The new array would look like, FILECON.txt FILECON.doc FILECON.rtf ASSORTED.txt ASSORTED.doc ASSORTED.rtf etc. etc. I'm not even sure if glob would be the correct way to do this (all the files with the same file name are in the same folders). Any help would be greatly appreciated!

    Read the article

  • Custom array sort in perl

    - by ABach
    I have a perl array of to-do tasks that looks like this: @todos = ( "1 (A) Complete online final @evm4700 t:2010-06-02", "3 Write thank-you t:2010-06-10", "4 (B) Clean t:2010-05-30", "5 Donate to LSF t:2010-06-02", "6 (A) t:2010-05-30 Pick up dry cleaning", "2 (C) Call Chris Johnson t:2010-06-01" ); That first number is the task's ID. If a task has ([A-Z]) next to, that defines the task's priority. What I want to do is sort the tasks array in a way that places the prioritized items first (and in order): @todos = ( "1 (A) Complete online final @evm4700 t:2010-06-02", "6 (A) t:2010-05-30 Pick up dry cleaning", "4 (B) Clean t:2010-05-30", "2 (C) Call Chris Johnson t:2010-06-01" "3 Write thank-you t:2010-06-10", "5 Donate to LSF t:2010-06-02", ); I cannot use a regular sort() because of those IDs next to the tasks, so I'm assuming that some sort of customized sorting subroutine is needed. However, my knowledge of how to do this efficiently in perl is minimal. Thanks, all.

    Read the article

< Previous Page | 144 145 146 147 148 149 150 151 152 153 154 155  | Next Page >