Today we are going to learn about strings and arrays in PHP. String and array functions are really handy in handling input and output data to manipulate it accordingly.
Some of the basic functions available in PHP to handle string are as under, We are not going to discuss anything in detail, you can try searching it online or see PHP manual.
Some Basic String Functions in PHP
Some of the basic functions available in PHP to handle string are as under, We are not going to discuss anything in detail, you can try searching it online or see PHP manual.
- str_replace() to find and replace data in a string
- strpos() find the position of the character/string within a string.
- ucwords() to make first letter capital
- strtolower() php function to lowercase the TEXT/STRING
- substr() find portion of a string.
- explode() This functions make pieces of a string with respect to any characters/string
Some Basic Array Functions in PHP
Here are some basic array manipulation functions in PHP- array() this is to create a new array like $names= array("name1","name2","name3");
- count() This functions returns number of entries in an array
- sort() sorts an array
- in_array() checks if a values is present in an array
No comments:
Post a Comment