This Post show how to upload data or audio files on server getting from URL and how to download that file in PC using URL.
First put URL in string like below:
$url = 'http://s.cdnpk.eu/pk-mp3/love-dose/s165352040.mp3'; To Download file in PC its a simple short-cut.using download attribute of <a> tag in HTML.
echo "<a href='".$url."' download='myfile.wav'>Download</a>";
Object oriented programming OOP is a programming
technique which is used by many programming languages and in this you have to
use classes which are a user define data type and you create functions and
attributes according to your use and then to use them you have to create an
object or instance of that class so that you are able to access the attribute
and operation of that class.
Advantages:
The object oriented programming have a main advantage of
code reusability that you have to create a class for one time and then just
have to create its instance where ever you want to use it.
The main concepts of object oriented programming are
given below:
·Inheritance
·Encapsulation
·Overloading
·Polymorphism
·Abstraction
As we already discuss all of these topics in over
previous posts but for now take a little review of all of them. Inheritance as the name suggests
inheriting something from other. In this we have a supper and sub class
hierarchy and sup classes are inherited form super classes and was able to use
the functionality and attributes of super class. Many type of inheritance is
there:
·Single level inheritance
·Multi-level inheritance
·Multiple inheritances
·Hybrid inheritance
For more there are other two very important concepts in
inheritance which is following:
·Generalization
·Specialization
Encapsulation
mean data hiding in classes we have to define the scope of every object and
function by default they are all private. We have normally three scope resolution
operator.
·Public
·Private
·Protected
·Sealed
·Sealed internal
Overloading
provides us the y to define same thing with different meaning there are two
type of overloading:
·Function overloading
·Operator overloading
In function
overloading we have many functions with same name but different data type
and in operator overloading we
re-write the functionality of different operators like =, <, >, ||, $$
etc.
Polymorphism
means many ways. In this we have many ways to class a function it cover the
topic of function overriding.
The polymorphic classes contain two types of functions
·Virtual function
·Override functions
OOP
languages:
There are many object oriented programming languages in
which some are pure object oriented and some have both procedural and also
object oriented way.
Java and C# are pure object oriented languages
C++, PHP, JavaScript are not pure object oriented but
have functionality of it.
Constructor:
The constructor is default functionality in all object
oriented languages which come with the classes whenever we create object of the
class the default constructor call and execute its code first without calling
it.
In C++, Java and C# constructor have the same name as
class name and have no data type but in PHP we have to define constructor like
this:
Function __construct( ) {
}
Example
class in PHP:
<?php
class person{
function
__construct(){
echo
"<h1>Person Information</h1>";
}
private
function get_ID($id){
echo
"<h3>Person ID No is :- ".$id.'</h3>';
}
private function
get_name($name){
echo
"<h3>Person name is :- ".$name.'</h3>';
}
private
function get_mob($mob){//have private scope
Add or Remove Input fields Dynamically Using JQuery - HTML
add/remove multiple input fields in html forms
if you are looking to add and remove duplicate input fields, here’s another jQuery example below to do the task for you. This jQuery snippet adds duplicate input fields dynamically and stops when it reaches maximum. Code: <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function() { var max_fields = 10; //maximum input boxes allowed var wrapper = $(".input_fields_wrap"); //Fields wrapper var add_button = $(".add_field_button"); //Add button ID var x = 1; //initlal text box count $(add_button).click(function(e){ //on add input button click e.preventDefault(); if(x < max_fields){ //max input box allowed x++; //text box increment $(wrapper).append('<div><input type="file" name="mytext[]"/><a href="#" class="remove_field">X</a></div>'); //add input box } }); $(wrapper).on("click",".remove_field", function(e){ //user click on remove text e.preventDefault(); $(this).parent('div').remove(); x--; }) }); </script> <div class="input_fields_wrap"> <button class="add_field_button">Add More Fields</button> <div><input type="file" name="mytext[]"></div> </div>
An interface is a reference type in Java, it is similar to class, it is a collection of abstract methods. A class implements an interface, thereby inheriting the abstract methods of the interface.
Along with abstract methods an interface may also contain constants, default methods, static methods, and nested types. Method bodies exist only for default methods and static methods.
Writing an interface is similar to writing a class. But a class describes the attributes and behaviours of an object. And an interface contains behaviours that a class implements.
Unless the class that implements the interface is abstract, all the methods of the interface need to be defined in the class.
An interface is similar to a class in the following ways:
An interface can contain any number of methods.
An interface is written in a file with a .java extension, with the name of the interface matching the name of the file.
The byte code of an interface appears in a .class file.
Interfaces appear in packages, and their corresponding bytecode file must be in a directory structure that matches the package name.
However, an interface is different from a class in several ways, including:
You cannot instantiate an interface.
An interface does not contain any constructors.
All of the methods in an interface are abstract.
An interface cannot contain instance fields. The only fields that can appear in an interface must be declared both static and final.
An interface is not extended by a class; it is implemented by a class.
An interface can extend multiple interfaces.
Declaring Interfaces:
The interface keyword is used to declare an interface.