Found 33676 Articles for Programming

filter_var() function in PHP

Ankith Reddy
Updated on 27-Dec-2019 10:13:34

536 Views

The filter_var() function is used to filter a variable with a specified filter.Syntaxfilter_var(variable, filter, options)Parametersvariable − The name of variable.filter − The name of filter to get ID.options − Specifies options to use.ReturnThe filter_var() function returns filtered data on success, or false on failure.Example Live Demo

filter_var_array() function in PHP

George John
Updated on 30-Jul-2019 22:30:23

617 Views

The filter_var_array() function is used to filter multiple variables. Syntax filter_var_array(arrayname, parameters) Parameters arrayname − An array to filter the data. parameters − It specifies an array of filter arguments. Return The filter_var_array() function returns an array of values of the requested variables on success or false on failure. Example Live Demo The following is the output. Array ( [stname] => Jack [stmarks] => 95 [stemail] => jack@abcde.com )

filter_list() function in PHP

Chandu yadav
Updated on 27-Dec-2019 10:12:05

462 Views

The filter_list() function is used to list all supported filters.Syntaxfilter_list()ReturnThe filter_list() function returns an array of filters available. It returns an empty array if there are no filters.Example Live DemoOutputThe following is the output.int257 boolean258 float259 validate_regexp272 validate_domain277 validate_url273 validate_email274 validate_ip275 validate_mac276 string513 stripped513 encoded514 special_chars515 full_special_chars522 unsafe_raw516 email517 url518 number_int519 number_float520 magic_quotes521 callback1024

filter_input_array() function in PHP

George John
Updated on 30-Jul-2019 22:30:23

569 Views

The filter_input_array() function gets names of external variables and filters them optionally. Syntax filter_input_array(type, arraydefine, add_empty) Parameters type − There are five types of inputs to check i.e. INPUT_GET, INPUT_POST, INPUT_COOKIE, INPUT_SERVER, or INPUT_ENV. arraydefine − It specifies an array of filter arguments. It is optional. add_empty − If value is True, it adds missing keys as NULL to the return value. Return The filter_input_array() function returns an array containing the values of the variables on success, or false on failure. Example The following is an example that use the filter_input_array() function to filter POST ... Read More

filter_input() function in PHP

Ankith Reddy
Updated on 27-Dec-2019 10:24:27

634 Views

The filter_input() function gets a name of external variable and filters it optionally.Syntaxfilter_input(type, var, filtername, options)Parameterstype − There are five types of inputs to check i.e. INPUT_GET, INPUT_POST, INPUT_COOKIE, INPUT_SERVER, or INPUT_ENV.var − The name of variable.filtername − The name of filter to get ID.options − Specifies options to use.ReturnThe filter_input() function returns the value of the variable on success, false on failure, or null if the parameter of variable is not set.Example Live Demo

filter_id() function in PHP

Arjun Thakur
Updated on 27-Dec-2019 10:23:35

323 Views

The filter_id() function returns the filter ID of provided filter name.Syntaxfilter_id(filtername)Parametersfiltername − The name of filter to get the ID from.ReturnThe filter_id() function returns filter ID on success or FALSE, if the filter does not exist.ExampleOutputThe following is the output.int = 257 boolean = 258 float = 259 validate_regexp = 272 validate_domain = 277 validate_url = 273 validate_email = 274 validate_ip = 275 validate_mac = 276 string = 513 stripped = 513 encoded = 514 special_chars = 515 full_special_chars = 522 unsafe_raw = 516 email = 517 url = 518number_int = 519 number_float = 520 magic_quotes = 521 callback = 1024

Send email using Java Program

Rishi Raj
Updated on 30-Jul-2019 22:30:23

940 Views

To send an e-mail using your Java Application is simple enough but to start with you should have JavaMail API and Java Activation Framework (JAF) installed on your machine. You can download latest version of JavaMail (Version 1.2) from Java's standard website. You can download latest version of JAF (Version 1.1.1) from Java's standard website. Download and unzip these files, in the newly created top level directories you will find a number of jar files for both the applications. You need to add mail.jar and activation.jar files in your CLASSPATH. Send a Simple E-mail Here is ... Read More

Private and final methods in Java Programming

Vikyath Ram
Updated on 27-Jun-2020 08:12:16

8K+ Views

In Java private methods are the methods having private access modifier and are restricted to be access in the defining class only and are not visible in their child class due to which are not eligible for overridden. However, we can define a method with the same name in the child class and could access in parent class.Like private methods final methods in Java are the methods having final non-access modifier instead of private and are again restricted to be accessed in the defining class only and are not visible in their child class due to which are not eligible ... Read More

filter_has_var() function in PHP

Ankith Reddy
Updated on 27-Dec-2019 10:22:28

400 Views

The filter_has_var() function is used to check that variable of specified type exists or not.Syntaxfilter_has_var(type, var)Parameterstype − There are five types of inputs to check i.e. INPUT_GET, INPUT_POST, INPUT_COOKIE, INPUT_SERVER, or INPUT_ENV.var − The name of variable.ReturnThe filter_has_var() function returns true on success and false on failure.ExampleThe following is an example that is a quick check for the input variable "email”. The value INPUT_GET is used for this. Live Demo

Private Constructors and Singleton Classes in Java Programming

Rishi Raj
Updated on 30-Jul-2019 22:30:23

2K+ Views

As we know the primary role of the constructor is to instantiate a class object now if we made the constructor as private then we restrict its calling to be only in defining a class and not in some other class. Now the singleton class in Java is defined as the class which restricts the instantiation of a class and ensure that only one instance of the class exists in the JVM. After first time if instantiate the singleton class the new variable also points to the first instance created. In order to create a singleton class we could use ... Read More

Advertisements