Using the explode command
To give an example of how to use the explode command to isolate a value:
How to use php's explode command to get the value you want...
First you want to set your value to a variable: $xyz = "www.domain.com";
Note that this could be the value from a query or a server variable or hard coded as the example above.
Next decide what you are dividing the variable by and use the following syntax: $abc=explode("criteria", $xyz);
So in this example we are going to choose a period $abc=explode(".", $xyz); to create three values, www, domain, and com respectively.
Now you can use the following variables to display the following values: $abc[0] would equal www, $abc[1] would equal domain, and $abc[2] would equal com.
You can use this syntax to perform many tasks. Take the example that you need the house number from a street address. Assuming your value string is set to the variable $address...
explode(" ", $address); would allow you to use $address[0] to use the house number as a value.
IT Liberty LLC brings you content such as Baltimore Restaurant Reviews, Christmas Gift Ideas, Dog Training Tips, Green Tea Info, Skincare Advice, Health and Fitness Information, Malware Advice, Credit Card Debt Consolidation, Online Coffee, Wedding Shower Planning, and Computer Questions
