click below button to copy the code. php tutorial - team
php for beginners Code Explanation :
In this statement we define the value for the variable $var1 and the explode function is used for splitting the element value according to the specified operator (Here we used the operator ‘ – ‘).
Variable “$var2” is used for counting the number of values presented in the variable “$var1”.
In this statement we use for loop for processing the array value.
Here, we display the value of the variable “$var1” in the browser using “echo” statement.
php coding Sample Output :
The output statement is, “wikitechy-is-a-technical-website” the term will be splited according to the hyphen (-) and the output will be shown as above.