Search Results

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

Page 69/1708 | < Previous Page | 65 66 67 68 69 70 71 72 73 74 75 76  | Next Page >

  • problem assigning array to variable

    - by shaw2thefloor
    Hi. I'm sure this is a simple one. I have an array in a simplexml object. When I try to assign the array to a variable, it only assigns the first index of the array. How can I get it to assign the whole array. This is my code. $xml = simplexml_load_string(FlickrUtils::getMyPhotos("flickr.photos.search", $_SESSION['token'])); $photosArray = $xml->photos; //$photosArray = $xml->photos->photo; //echo gettype($photosArray); print_r($photosArray); This is the result of the print_r($photosArray); SimpleXMLElement Object ( [@attributes] = Array ( [page] = 1 [pages] = 1 [perpage] = 100 [total] = 4 ) [photo] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [id] => 5335626037 [owner] => 57991585@N02 [secret] => bd66f06b49 [server] => 5210 [farm] => 6 [title] => 1 [ispublic] => 1 [isfriend] => 0 [isfamily] => 0 ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [id] => 5336238676 [owner] => 57991585@N02 [secret] => 898dffa011 [server] => 5286 [farm] => 6 [title] => 2 [ispublic] => 1 [isfriend] => 0 [isfamily] => 0 ) ) [2] => SimpleXMLElement Object ( [@attributes] => Array ( [id] => 5335625381 [owner] => 57991585@N02 [secret] => 60a0c84597 [server] => 5126 [farm] => 6 [title] => 4 [ispublic] => 1 [isfriend] => 0 [isfamily] => 0 ) ) [3] => SimpleXMLElement Object ( [@attributes] => Array ( [id] => 5335625195 [owner] => 57991585@N02 [secret] => 49348c1e8b [server] => 5126 [farm] => 6 [title] => 3 [ispublic] => 1 [isfriend] => 0 [isfamily] => 0 ) ) ) ) Thanks for youe help!

    Read the article

  • Fastest way to add prefix to array keys?

    - by Kirzilla
    Hello, What is the fastes way to add string prefixes to array keys? was $array = array( '1' => 'val1', '2' => 'val2', ); needed $array = array( 'prefix1' => 'val1', 'prefix2' => 'val2', ); According to http://www.phpbench.com/ (see Modify Loop) I should use "for" statement, but probably there is more elegant way? Thank you.

    Read the article

  • Is there any legitimate use for bare strings in PHP?

    - by Robert
    This question got me thinking about bare strings. When PHP sees a string that's not enclosed in quotes, it first checks to see if it's a constant. If not, it just assumes it's a string and goes on anyway. So for example if I have echo $foo[bar]; If there's a constant called bar it uses that for the array key, but if not then it treats bar as a bare string, so it behaves just like echo $foo["bar"]; This can cause all kinds of problems if at some future date a constant is added with the same name. My question is, is there any situation in which it actually makes sense to use a bare string?

    Read the article

  • Create unordered list tree menu from data stored in an table with the adjacency list model...php

    - by Ronedog
    I need to create a tree menu of "nth" subcategories. I settled on using the adjacency list model for my table structure, because I won't be updating this table very much and this seemed the easiest to implement for my use. I want to style the output using "ul" and "li" tags...I already have a css and jquery solution to do the styling. My problem comes from pulling the data out of the database and using a recursive function via PHP to build the list ... the list is a concatenated string that gets parsed to build the tree. I'm really having a hard time getting the closing "ul" and "li" tags to line up just where they need to be. Is this the best way to do this? Are there other better ways using arrays or something like that to do this? Any examples you can point me to of "best practices" for building a list like this will be appreciated. Thanks.

    Read the article

  • I'm an experienced PHP programmer, how would it be for me to learn and use Django and Ruby on Rails?

    - by João Paulo Apolinário Passos
    I'm an experienced PHP programmer, I still have lots to learn but I consider myself experienced. I sometimes use pure PHP and sometimes some framework like CodeIgniter. I always wanted to learn new technologies like Python and Ruby, and their best frameworks for web are Django and Ruby on Rails, but I want to ask to persons like me who migrated from PHP to some of this technologies if is it worth it; Thank you

    Read the article

  • Using PHP version 5.2 or 5.3 for commercial products?

    - by Ash
    I'm doing research on what version of PHP to use when creating commercial scripts that will be sold to the public. Although the available stats aren't great, PHP 5.3 shows a 18.5% adoption rate. I'd like to use Symfony to create these scripts and it requires 5.3.2 which shows an even lower adoption rate (roughly 13% of that 18.5% use less than 5.3.2). Would I be risking much by jumping straight to PHP 5.3.2+ or should I ignore the stats and plough ahead?

    Read the article

  • What is the difference between Java 6 and PHP 5.4? [closed]

    - by Mashael
    First of all, let me explain the matter. I'm in a class where we learn Java 6 OOP fundamentals. However, my goal is to learn PHP (the last version) next. So, my question: Is there a big difference between PHP and Java 6 in OOP concepts? Meaning that after I finish the OOP class in Java will I find a lot of things that need to be learned in PHP regarding OOP? Update: *My goal of learning PHP next is to build dynamic sites* (I'm not sure of other options) and to follow OOP.

    Read the article

  • Generating Deep Arrays: Shallow to Deep, Deep to Shallow or Bad idea?

    - by MobyD
    I'm working on an array structure that will be used as the data source for a report template in a web app. The data comes from relatively complex SQL queries that return one or many rows as one dimensional associative arrays. In the case of many, they are turned into two dimensional indexed array. The data is complex and in some cases there is a lot of it. To save trips to the database (which are extremely expensive in this scenario) I'm attempting to get all of the basic arrays (1 and 2 dimension raw database data) and put them, conditionally, into a single, five level deep array. Organizing the data in PHP seems like a better idea than by using where statements in the SQL. Array Structure Array of years( year => array of types( types => array of information( total => value, table => array of data( index => db array ) ) ) ) My first question is, is this a bad idea. Are arrays like this appropriate for this situation? If this would work, how should I go about populating it? My initial thought was shallow to deep, but the more I work on this, the more I realize that it'd be very difficult to abstract out the conditionals that determine where each item goes in the array. So it seems that starting from the most deeply nested data may be the approach I should take. If this is array abuse, what alternatives exist?

    Read the article

  • should I learn html/css before php even for using database? [on hold]

    - by Sadegh
    I saw lots of question about this topic and all of them were talking if someone want to use php for "building web pages", should learn html first or not. and most of them said yes, because most of the time you make web page with both php and html (and maybe css). But If I just want to use php for contacting to My Database (for example MySQL) and nothing more, shuold I learn any html or CSS first or not?

    Read the article

  • Include all php files in one file and include that file in every page if we're using hiphop?

    - by Hasan Khan
    I understand that in normal php if we're including a file we're merging the source of it in the script and it would take longer for that page to be parsed/processed but if we're using HipHop shouldn't it be ok to just create one single php file and include every file in it (that contains some class) and every page which needs those classes (in separate file each) can just include one single php file? Would this be ok in presence of HipHop?

    Read the article

  • Using PHP version 5.2 or 5.3 for end-user commercial products?

    - by Ash
    I'm doing research on what version of PHP to use when creating commercial scripts that will be sold to end users. Although the available stats aren't great, PHP 5.3 shows a 18.5% adoption rate. I'd like to use Symfony to create these scripts and it requires 5.3.2 which shows an even lower adoption rate (roughly 13% of that 18.5% use less than 5.3.2). Would I be risking much by jumping straight to PHP 5.3.2+ or should I ignore the stats and plough ahead?

    Read the article

  • What is the best way to become a professional in PHP and Website Building?

    - by Mr.TAMER
    I would like to become a professional in php, I have learned nearly all about the language syntax and concepts and I have a good knowledge in C and C++, which made it easier to become familiar with PHP. (Of course, I learned MySql too.) But I don't feel like being able to build even a little good website of my own! It looks like PHP is all about knowing lots of functions and using them, while in fact I don't think it's like that, is it? How can I become a professional in PHP and Website Building? I would do anything and spend whatever amount of time required for that. EDIT I've also a very good knowledge in HTML and a normal knowledge in CSS and JavaScript. Sorry for not mentioning that, I just thought it was implicitly included.

    Read the article

  • Best Terminology for a particular php-based site architecture? [closed]

    - by hen3ry
    For a site... o whose overall look-and-feel is generated by one php page ("index.php"). o in which "index.php" provides for all pages served the following required components: The DOCTYPE, opening html tag, the head section, the opening body tag, the end-body tag, and end-html tag. o which uses computed hierarchical navigation menus within "index.php" to offer visitors access to the site content. o in which all content is stored in individual files that contain "headerless html". (The DOCTYPE, etc. etc. being being provided by "index.php" as described above.) Q1: what term best describes this architecture? I'm seeking a concise descriptor that is useful in conversation and definitive as a search term, in whole-web searches, and searching here on Pro Webmasters. Q2: what term best describes the individual content files? Same general goals for the descriptor as above. As you see above, I couldn't avoid using the term "headerless html", my best choice. But this term does not seem to be in general use. I've found some people use this term to describe such as my content files, but others use it quite differently.

    Read the article

  • Advice: should I focus on PHP + MySQL, or split my time for more JS and CSS? [closed]

    - by fakaff
    I started learning web development about three months ago (in between working my regular job), and I'm finally starting to get some vague, distant notion of understanding. I find the server-side stuff the most interesting; though I've not gone anywhere near Apache quite yet, which I assume will be necessary at some point. As cool as toying around with visuals and UI is, programming and database stuff inspires me with new ideas and possibilities every minute (I've even bought, on a whim, a wonderfully dry bunch of books on database theory and relational algebra). And whatever CSS or Javascript tutorial I'm doing, it often feels like a distraction from the PHP/MySQL stuff I'd rather be playing with. For someone like me who's just starting out, which is the most advisable course of action? (in terms of being marketable as a programmer): To focus on PHP and SQL stuff exclusively, and only once I master those to diversify my skills. To first learn all three (PHP/MySQL, Javascript, CSS and design) and only once I'm fluent in all three focus on PHP and databases?

    Read the article

  • Pros and cons of PHP vs C,C++ as language in a programming interview ?

    - by DhruvPathak
    Hi All, Though this is a matter of personal choice and comfort. I would want your views on a situation like this. Programmer A has been working on PHP for some years, and has had prior experience in C.C++ during algorithm courses in university. The current fluency is good is PHP,but C,C++ can also be brushed up. So for interviews with major companies who put lot of emphasis on algorithms and data structures in programming interview e.g. binary trees, linked lists, arrays , strings . What should programmer A do ? Try to implement those things in PHP ( which is generally more suited for web development rather than programming contests/interviews ) or Or brush up the C,C++ skills and keep them as primary tool for tackling interview questions. What are advantages/ disadvantages of each language for an environment like programming contest or an interview ? Why would you recommend,not recommend Programmer A to participate in a contest like google code Jam/ ACM ICPC using PHP instead of C++ ? ( assuming PHP is allowed as a language there)

    Read the article

  • I am confused between PHP and ASP.NET to choose as a career in Indian software development context

    - by Confused_Guy
    I need your help(specially from the software professionals of India). I have completed MCA in 2009. After that instead of joining software company I did a Teaching job nearby by home. In the mean time I prepared myself for public sector jobs(bank). I continued my job for 1 year more and left it in 2010. Now in 2012 ,I feel that I should have done the software jobs,so that I could earn my bread and butter and in the mean time I could have prepared for the job.Because,according to my qualification it will give me the best salary. Now I want to go back in software industries. Now all of them are asking for experiences.And I don't have any.....So which language should I learn? And what should I do,because I have two year gap. Some of my friends suggested me to go with PHP as its easier and quicker to get job in India. But Here the PHP guys are getting less salary as compared to ASP.NET. I am planning to begin with PHP and but is it possible to switch to ASP.NET after two years experience. JAVA: I know upto servlet & JSP. Which is nothing in current market. ASP.NET: I know the basics of asp.net upto database connection ie(Gridview). PHP: Only the basics. So what should I do now. Which is most demanding. Does PHP is good, I feel its more like JSP pages. Please guide me, All your suggestions are needed for me.

    Read the article

  • How do I upload large (30MB) files via a web interface?

    - by Dan
    Because I'm stumped... The client needs to be able to upload large images to a library but the upload fails after 5-6MB (over my poor connection). It seems to be timing out as the filesize at fail isn't consistent. The setup is a form which is accepted by PHP. I've googled and played with php.ini and everything is set for big uploads and long timeouts. Platform is a dedicated windows server at GoDaddy. What's going wrong?

    Read the article

  • I've failed at PHP several times. Is Ruby the Cure? [closed]

    - by saltcod
    Extremely, extremely subjective question here, but its something I've been struggling with for quite a while. I've seriously tried to become a reasonable PHP coder for the past several years. But I've really failed every time. I hate to describe myself as a beginner, b/c I've been designing websites (using WordPress, Drupal, etc) for years, but still I just can't seem get better at programming. Could it be that I have some kind of allergy to PHP? I went through Chris Pine's awesome into to Ruby about a week ago (for about the fifth time), and though it did all all seem much clearer to me than PHP, I wondered if I was just switching languages to find an easy way out? The things I struggle with in PHP all seem elementary—when to use a function, how to return database queries in foreach/while statements, when to turn those queries into reusable functions, adding arguments to functions, etc, etc. And all the OOP stuff that I keep seeing these days just files over my head. I guess my question(s) are: Am I going about learning how to program in the wrong way? Do I have some aversion to PHP that's preventing me from catch on? If I keep pushing at Ruby/Rails, will it just eventually 'click'. Or, the one I fear, am I just unlikely to ever be a programmer? Honesty appreciated. Terry

    Read the article

  • Send some form info to a PHP page to be processed without going to that page? [closed]

    - by zuko
    Okay, so I'm not very familiar with php. I have a very simple form, just 2 text fields. All I want to do is, after validating with JavaScript, send these two string fields in an email to a pre-defined email address. I understand how JavaScript works on the client side; you can respond to user events, etc. And PHP is server-side. What I'm having trouble grasping and figuring out is how do I run PHP functions, etc when I want? I figured out how to use the 'action' attribute of the form to send the data via POST to another PHP page. But this simply opens that page. I don't want to open the page I just want to do some processing and send a message back to the page the user is still on. How do I go about something like that? Thanks.

    Read the article

  • PHP 5.3 SOAP deprecated errors

    - by Vincent
    All, I am using PHP 5.3.1 under Ubuntu and using the SOAP package. I am getting the following errors when I include SOAP/Client.php. Any one knows how to get this working? Thanks Deprecated: Assigning the return value of new by reference is deprecated in /opt/lampp/lib/php/SOAP/WSDL.php on line 214 Deprecated: Assigning the return value of new by reference is deprecated in /opt/lampp/lib/php/SOAP/WSDL.php on line 791 Deprecated: Assigning the return value of new by reference is deprecated in /opt/lampp/lib/php/SOAP/WSDL.php on line 1159 Deprecated: Assigning the return value of new by reference is deprecated in /opt/lampp/lib/php/SOAP/WSDL.php on line 1685 Deprecated: Assigning the return value of new by reference is deprecated in /opt/lampp/lib/php/HTTP/Request.php on line 228 Deprecated: Assigning the return value of new by reference is deprecated in /opt/lampp/lib/php/HTTP/Request.php on line 324 Deprecated: Assigning the return value of new by reference is deprecated in /opt/lampp/lib/php/HTTP/Request.php on line 602 Deprecated: Assigning the return value of new by reference is deprecated in /opt/lampp/lib/php/HTTP/Request.php on line 621 Strict Standards: Redefining already defined constructor for class Net_URL in /opt/lampp/lib/php/Net/URL.php on line 122

    Read the article

  • PHP splitting arrays into groups based on one field's value

    - by Dan
    I have an array containing arrays of names and other details, in alphabetical order. Each array includes the first letter associated with the name. Array ( [0] => Array ( [0] => a [1] => Alanis Morissette ) [1] => Array ( [0] => a [1] => Alesha Dixon ) [2] => Array ( [0] => a [1] => Alexandra Burke ) [3] => Array ( [0] => b [1] => Britney Spears ) [4] => Array ( [0] => b [1] => Bryan Adams ) ) I'd like to display them grouped by that first initial, eg: A - Alanis Morissette Alesha Dixon Alexandra Burke B - Britney Spears Bryan Adams etc... Is this at all possible?

    Read the article

  • Encrypt nsdata in iphone and decrypt it in php

    - by Gaurav Arora
    Hi All, I am new to Iphone development , I want to create an application in which I have to upload some data on php server using my Iphone application. For this I have an file on the Iphone whose content I have to upload on php server. For this I have converted the content of the file in NSData and now I want to encrypt this nsdata object and then pass it to the php server and on php server firstly I have to decrypt the nsdata object then I have to upload it on the server. But I am not able to find any way by which I can encrypt some data in Iphone app and then decrypt it in php. And also I want to compress the encrypted data before transferring it to php and then uncompress that data on php. The complete flow of my application is IPhone NSData -- Encrypted NsData -- Compressed Encrypted Data php Compressed Encrypted Data -- uncompressed encrypted data -- decrypted (original) NSData. Can some one help me how can I develop such application? Thanks in advance. Gaurav

    Read the article

  • Trying to INstall PHP on windows 7 ultimate with IIS6

    - by Jack
    I am trying to install php on my windows 7 machine. I have installed IIS 6.x and I have also installed php. I used this tutorial http://blogs.iis.net/bills/archive/2006/09/19/How-to-install-PHP-on-IIS7-_2800_RC1_2900_.aspx The only thing I didnt understand is this part: 4) Install IIS7, making sure you install the ISAPI Extension component (for PHP-ISAPI - which is what I use) or the CGI component (if you prefer CGI) during IIS installation (ISAPI and CGI are not installed by default) Now when i go to localhost I get an error. HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid. 4: <handlers> 5: <add name="PHP" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\web\php5\php-cgi.exe" resourceType="Unspecified" /> 6: </handlers> Also php pages do not work in IE, please help

    Read the article

  • php nested include behavior

    - by nute
    In many places in my code, I do things like: file1.php: <?php include('../file2.php'); file2.php: <?php include('anotherdirectory/file3.php'); Depending on the server or settings I try this on, it either sets the relative paths from the "includer" or from the "includee". This is really confusing. So file1 might try to include "../anotherdirectory/file3.php" or it might try "anotherdirectory/file3.php". What settings dictate this behavior? I want to have control over this...

    Read the article

  • SWIG generated code fails to run on PHP 5.3.2 undefined symbol: zend_error_noreturn

    - by wookiebreath
    I have a library that I have been using successfully with PHP 5.1.6 with the help of some wrapper code generated by SWIG (v1.3.40). I have just upgraded to PHP 5.3.2 and I am seeing the following error: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/myLib_php.so' - /usr/lib/php/modules/myLib_php.so: undefined symbol: zend_error_noreturn in Unknown on line 0 On investigation it appears that the wrapper code produced by SWIG (myLib_wrap.c) includes calls to the PHP function: zend_error_noreturn and that this function isn't available in PHP 5.3.2? Has anyone seen this issue before? Things seem to work if I manually update the generated code so that instead of calling zend_error_noreturn it just calls zend_error. Is this approach safe?

    Read the article

< Previous Page | 65 66 67 68 69 70 71 72 73 74 75 76  | Next Page >