Question - 8: How can I embed a java program in php file and what changes have to be done in php. The Java extension provides a simple and effective means for creating and invoking methods on Java objects from PHP.
Example Code: s. Date' ;? The behavior of these functions is affected by settings in php. Table 1. Java configuration options Name R. Default Changeable java. PHP does not require or support explicit type definition in variable declaration; a variable's type is determined by the context in which that variable is used. If any of the operands is a float, then all operands are evaluated as floats, and the result will be a float. Otherwise, the operands will be interpreted as integers, and the result will also be an integer.
Note that this does NOT change the types of the operands themselves; the only change is in how the operands are evaluated. If you wish to change the type of a variable, see settype. Note: The behavior of an automatic conversion to array is currently undefined. Question - What is the difference between Reply-to and Return-path in the headers of a mail function?
Reply-to: Reply-to is where to delivery the reply of the mail. Return-path: Return path is when there is a mail delivery failure occurs then where to delivery the failure notification. Question - What type of headers have to be added in the mail function to attach a file? Question - What changes I have to do in php. Ans: Make the following line uncomment like: ns. Question - s. What is the default session time in php and how can I change it? Ans: O. The default session time in php is until closing of browser View All Answers R.
Question - G. How many ways we can give the output to a browser? If NULL, localhost is assumed. View All Answers Q. What type of inheritance that php supports? Ans: In PHP an extended class is always dependent on a single base class, that is, multiple inheritance is not supported.
Classes are extended using the keyword 'extends'. Explain normalization concept? Ans: ns. The normalization process involves getting our data to conform to three progressive normal forms, and a higher level of normalization cannot be achieved until the previous levels have been achieved there are actually five normal forms, but the last two are mainly academic and will not be discussed.
We want to ensure that there is no duplication of data in a given row, and that every column stores the least amount of information possible making the field atomic. As stated earlier, the normal forms are progressive, so to achieve Second Normal Form, your tables must already be in First Normal Form. In Third Normal Form we are looking for data in our tables that is not fully dependent on the primary key, but defendant on another value in the table View All Answers w. Question - er.
What is maximum size of a database in mysql? Ans: s. If the operating system or filesystem places a limit on the number of files in a directory, MySQL is bound by that constraint. The efficiency of the operating system in handling large numbers of files in a directory can place a practical limit on the number of tables in a database.
If the time required to open a file in the directory increases significantly as the number of files increases, database performance can be adversely affected.
The amount of available disk space limits the number of tables. MySQL 3. With this larger allowed table size, the maximum effective table size for MySQL databases is usually determined by operating system constraints on file sizes, not by MySQL internal limits. This allows a table to exceed the maximum individual file size. The tablespace can include raw disk partitions, which allows extremely large tables. The maximum tablespace size is 64TB. Question - What are the advantages of stored procedures, triggers, indexes in PHP?
Ans: A stored procedure is a set of SQL commands that can be compiled and stored in the server. Once this has been done, clients don't need to keep re-issuing the entire query but can refer to the stored procedure. This provides better overall performance because the query has to be parsed only once, and less information needs to be sent between the server and the client.
You can also raise the conceptual level by having libraries of functions in the server. However, stored procedures of course do increase the load on the database server system, as more of the work is done on the server side and less on the client application side.
Triggers will also be implemented. A trigger is effectively a type of stored procedure, one that is invoked when a particular event occurs. For example, you can install a stored procedure that is triggered each time a record is deleted from a transaction table and that stored procedure automatically deletes the corresponding customer from a customer table when all his transactions are deleted.
Indexes are used to find rows with specific column values quickly. Without an index, MySQL must begin with the first row and then read through the entire table to find the relevant rows. The larger the table, the more this costs. If the table has an index for the columns in question, MySQL can quickly determine the position to seek to in the middle of the data file without having to look at all the data.
Question - What are the difference between abstract class and interface? Ans: In. Abstract class: abstract classes are the class where one or more methods are abstract but not necessarily all method has to be abstract. Abstract methods are the methods, which are declare in its class but not define. The definition of those methods must be in its extending class. Interface: Interfaces are one type of class where all the methods are abstract. That means all the methods only declared but not defined.
All the methods must be define by its implemented class. Question - How can I make a script that can be bilingual supports English, German? Ans: ie. You can change charset variable in above line in the script to support bilanguage. View All Answers w. Question - How can we get second of the current time using date function? What is the use of friend function in PHP?
Ans: io. Friend functions Sometimes a function is best shared among a number of different classes. Such functions can be declared either as member functions of one class or as global functions. In either case they can be set to be friends of other classes, by using a friend specifier in the class that is admitting them. Such functions can use all attributes of the class which names them as a friend, as if they were themselves members of that class.
A friend declaration is essentially a prototype for a member function, but instead of requiring an implementation with the name of that class attached by the double colon syntax, a global function or member function of another class provides the match.
It is also possible to specify all the functions in another class as friends, by specifying the entire class as a friend. How can we destroy the cookie in PHP?
Ans: Set the cookie with a past expiration time. Trigger the JavaScript code on any event like onSelect of drop down list box, onfocus, etc document. View All Answers ie. Question - How can I know that a variable is a number or not using a JavaScript? Answer 2: Definition and Usage ue. The isNaN function is used to check if a value is not a number. The value to be tested st.
View All Answers io. Ans: Using imagetypes function to find out what types of images are supported in your PHP engine. This function returns a bit-field corresponding to the image formats supported by the version of GD linked into PHP. Ans: w. Example: setcookie 'Test' ; View All Answers s.
Question - How to set cookies in PHP? Ans: setcookie 'variable','value','time' R. Question - How can we increase the execution time of a php script? If this is reached, the script returns a fatal error. If seconds is set to zero, no time limit is imposed. How can we encrypt and decrypt a data presented in a table using MySQL?
Question - What is meant by nl2br? View All Answers s. Ans: PHP4 cannot support oops concepts and Zend engine 1 is used. PHP5 supports oops concepts and Zend engine 2 is used. Error supporting is increased in PHP5. Ans: Data is stored in name. The most general way to satisfy a GROUP BY clause is to scan the whole table and create a new temporary table where all rows from each group are consecutive, ue. If two rows will hawe the same value in col1 it will try to sort them according to col2 and so on.
However browsers also uses MIME standard to transmit files. MIME has a header which is added to a beginning of the data. When browser sees such header it shows the data as it would be a file for example image Some examples of MIME types: A. Answer 2: Multipurpose Internet Mail Extensions. The standard provides for a system of registration of file types with information about the applications needed to process them.
Github Snappy Library Github wkhtmltopdf. It uses the excellent webkit-based wkhtmltopdf and wkhtmltoimage available on OSX, linux, windows. You will have to download wkhtmltopdf 0. These run entirely "headless" and do not require a display or display service. You can even download a wkhtmltopdf distribution as a composer dependency and reference the Binary dinamically in your project. Github Homepage.
It support customization and a lot of key features when you work with the creation of PDF files. This library supports Unicode fonts and it is actively maintained by Nicola Asuni in the Github repository.
The new learners can take from php tutorial pdf free download or php tutorial pdf free. Our focal point is to present you with essential knowledge of HTML. We provide you with the plenty of php tutorial pdf for the new and beginners, php book pdf for beginners and professionals , php tutorial pdf free download for new students , php tutorial pdf free download for the new kid on the block, php ebook free download, are provided for the online study purpose.
The only difference is that the former has no return value and can take several parameters, while the latter has a return value of 1 and can only take one argument. An important note: Like all other PHP commands, functions echo and print are not case sensitive. Functions are shortcuts for commonly used chunks of code.
Instead, you create them once and use the shortcuts when you need them. Much of this PHP cheat sheet is devoted to that.
Quick explanation: the first part is the function of a name reminder: function names are not case sensitive. After that, everything between the curly braces is what the function does when called. Similarly to most other programming languages, PHP lets you work with variables and constants. These are pieces of code that store different kinds of information.
To do anything with variables, you first need to define them. A typical example:. There is no need to declare PHP variables in a certain way. They automatically take on the type of data they contain. Variables can be available in different scopes, meaning the part of a script you can access them. This can be global , local and static.
Any variable declared outside of a function is available globally. That means it can be accessed outside of a function as well. If you declare a variable inside a function, it will have a local scope. The consequence is that it can only be accessed within that function. A way around this is to prepend a local variable with global. That way, it becomes part of the global scope.
PHP also comes with a number of default variables called superglobals. Aside from variables, you can also define constants which also store values. Constants are useful since they allow you to change the value for an entire script in one place instead of having to replace every instance of it. They are also global in nature, meaning they can be accessed from anywhere.
Arrays are a way to organize several values in a single variable so that they can be used together. While functions are for blocks of code, arrays are for the values — a placeholder for larger chunks of information.
In programming, speech strings are nothing more than text. As we have settled earlier, they are also a valid value for variables.
0コメント