In this case, simply prepending/appending the separator next to implode() is not enough, so I made this little helper function. Sometimes it's necessary to add a string not just between the items, but before or after too, and proper handling of zero items is also needed. ![]() The following would be a crude and somewhat useless code, but should illustrate my example… just think that instead of 5 fields, I have 30 for which I need to count value occurences which will validate the form.Getting Started Introduction A simple tutorial Language Reference Basic syntax Types Variables Constants Expressions Operators Control Structures Functions Classes and Objects Namespaces Enumerations Errors Exceptions Fibers Generators Attributes References Explained Predefined Variables Predefined Exceptions Predefined Interfaces and Classes Predefined Attributes Context options and parameters Supported Protocols and Wrappers Security Introduction General considerations Installed as CGI binary Installed as an Apache module Session Security Filesystem Security Database Security Error Reporting User Submitted Data Hiding PHP Keeping Current Features HTTP authentication with PHP Cookies Sessions Dealing with XForms Handling file uploads Using remote files Connection handling Persistent Database Connections Command line usage Garbage Collection DTrace Dynamic Tracing Function Reference Affecting PHP's Behaviour Audio Formats Manipulation Authentication Services Command Line Specific Extensions Compression and Archive Extensions Cryptography Extensions Database Extensions Date and Time Related Extensions File System Related Extensions Human Language and Character Encoding Support Image Processing and Generation Mail Related Extensions Mathematical Extensions Non-Text MIME Output Process Control Extensions Other Basic Extensions Other Services Search Engine Extensions Server Specific Extensions Session Extensions Text Processing Variable and Type Related Extensions Web Services Windows Only Extensions XML Manipulation GUI Extensions Keyboard Shortcuts ? This help j Next menu item k Previous menu item g p Previous man page g n Next man page G Scroll to bottom g g Scroll to top g h Goto homepage g s Goto search What I’m trying to do is learn a way to optimize my code, since that ammount of conditional checks should be really unnecessary. I am currently doing this verification, with more than 25 if’s and "switch"s… but with a code just as my example, I can do the same in just a few lines… This gives me the field names…but as you might see in my example, I already know the names… I need to dynamically use those names to theck the current field’s value SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='Mytable" AND TABLE_SCHEMA=‘MySchema’, The creation of an array in PHP can be done in two ways. I believe you suggest something like this: If you check my example, I don’t just want to get the “field name”… i NEED the field name to get it’s current value, and with that, act accordingly to verify and validate the form. If you need those values in the SQL statement (i.e. ![]() Both of them have advanced search choose. ![]() Thanks for your interest, but either I’m not understanding your logic, or I was unable to explain what I need in the first post. The array with the access credentials that must be passed in the settings parameter varies according to the API used. In case you need those values on different places, store them in an array and pass the array to the grid. Hi I have two grid applications and from the first one I have link to the second.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |