PHP wordwrap Text file to array String to Date Functions

PHP wordwrap Text file to array String to Date Functions

Today, We want to share with you PHP wordwrap Text file to array String to Date Functions.
In this post we will show you Basic PHP String Functions – string to date,Text file to array and wordwrap, hear for PHP String Functions substr, strlen, strtolower, explode, strpos we will give you demo and example for implement.
In this post, we will learn about PHP Convert a string to an array with an example.

List of 3 String Functions using PHP

The PHP all string functions are main part of the PHP core (Basic).
String functions call other means sequences of characters.
Some versions are not supported.

convert string to date format using PHP

$string_data = "22 october 2016";
$result_data=explode(" ",$string_data);
echo $result_data[0];
echo $result_data[1];
echo $result_data[3];
var_dump(result_data);

wordwrap using PHP

	$stringdata="How to convert string wordwrap using PHP step by step";
	$newtext = wordwrap($stringdata, 10, "<br />\n");
	echo $newtext;
	
[php]
<h3>convert textfile to array using php</h3>

<p>File Name : index.php</p>

[php]

$file_color_name = fopen("color.txt", "r");
$colors_name = array();

while (!feof($file_color_name)) {
   $colors_name[] = fgets($file_color_name);
}

fclose($file_color_name);
echo "<pre>";
print_r($colors_name);
echo "</pre>";

Text file to array using PHP

File Name color.txt

ASSORTED
BLACK
BLACK, BLACK PANEL
BLACK, CHARCOAL INSET
BLACK, FOREST GREEN
BLACK, GOLD
BLACK, GREY
BLACK, GREY PANEL
BLACK, MAROON
BLACK, NAVY
BLACK, OPTIC BLUE
BLACK, OPTIC GREEN
BLACK, OPTIC ORANGE
BLACK, OPTIC YELLOW
BLACK, ORANGE
BLACK, PINK PIPE
BLACK, PURPLE
BLACK, ROYAL
BLACK, ROYAL PIPE
BLACK, SCARLET
BLACK, SCARLET PIPE
BLACK, WHITE
BLACK, WHITE PIPE
BLACK,PINK
BLACK,ROYAL PIPE
BLACK,SCARLET
BLACK,WHITE PIPE
BLUE
BROWN
CAMO BLACK
CAMO CARDINAL
CAMO COL. BLUE
CAMO FOREST
CAMO MAROON
CAMO NAVY
CAMO OPTIC ORANGE
CAMO OPTIC PINK
CAMO OPTIC YELLOW
CAMO PURPLE
CAMO RED,WHITE,BLUE
CAMO ROYAL
CAMO SCARLET
CAMO WHITE
CARDINAL
CARDINAL, WHITE
CHARCOAL
CHARCOAL, BLACK INSET
CHARCOAL, WHITE
CREAM
FOREST GREEN
FOREST GREEN, GOLD
FOREST GREEN, WHITE
FUCHSIA, WHITE
GOLD
GOLD, BLACK
GOLD, WHITE
GRAPHITE
GREEN
GREY
GREY, BLACK
GREY, BLACK PIN
GREY, BLACK PIPE
GREY, BLACK SLEEVE
GREY, CHARCOAL INSET
GREY, NAVY PIN
GREY, NAVY PIPE
GREY, NAVY SLEEVE
GREY, ROYAL PIPE
GREY, ROYAL SLEEVE
GREY, SCARLET PIPE
GREY, SCARLET SLEEVE
GREY,BLACK PIPE
GREY,NAVY
GREY,ROYAL PIPE
GREY,SCARLET
HOT PINK
KELLY GREEN
LIGHT BLUE
LIGHT BLUE, WHITE
LIGHT SILVER
LIME GREEN
LIME GREEN, WHITE
MAROON
MAROON, WHITE
NAVY
NAVY, PURPLE
NAVY, WHITE
NEON GREEN
NEON OPTIC YELLOW
ONYX
OPTIC BLUE, OPTIC ORANGE
OPTIC GREEN
OPTIC ORANGE
OPTIC ORANGE, OPTIC BLUE
OPTIC PINK
OPTIC PINK, PURPLE
OPTIC YELLOW
OPTIC YELLOW, GREY PANEL
ORANGE
color
ORANGE, BLACK
ORANGE, GOLD
ORANGE, WHITE
PINK
PINK, GREY PANEL
PINK, WHITE
PURPLE
PURPLE, GOLD
PURPLE, OPTIC YELLOW
PURPLE, WHITE
PURPLE,GOLD
RED
RED, BLACK
RED, WHITE, BLUE
ROYAL
ROYAL, GOLD
ROYAL, SCARLET
ROYAL, WHITE
SCARLET
SCARLET, BLACK
SCARLET, GREY
SCARLET, PURPLE
SCARLET, WHITE
SCARLET,WHITE
SILVER
SILVER, BLACK
SKY BLUE, WHITE
TAN
TEAL
TEXAS ORANGE
VEGAS GOLD
WHITE
WHITE, BLACK
WHITE, BLACK PIN
WHITE, BLACK PIPE
WHITE, BLACK SLEEVE
WHITE, CAMO SCARLET
WHITE, CARDINAL
WHITE, ELECTRIC BLUE
WHITE, FOREST GREEN
WHITE, FOREST GREEN SLEEVE
WHITE, GOLD
WHITE, GOLD SLEEVE
WHITE, GREY
WHITE, GREY INSET
WHITE, GREY PANEL
WHITE, HOT PINK
WHITE, LIGHT BLUE
WHITE, MAIZE
WHITE, MAROON SLEEVE
WHITE, NAVY
WHITE, NAVY PIN
WHITE, NAVY PIPE
WHITE, NAVY SLEEVE
WHITE, OPTIC ORANGE
WHITE, OPTIC YELLOW
WHITE, ORANGE SLEEVE
WHITE, PINK
WHITE, PINK SLEEVE
WHITE, PURPLE
WHITE, PURPLE SLEEVE
WHITE, ROYAL
WHITE, ROYAL PIPE
WHITE, ROYAL SLEEVE
WHITE, SCARLET
WHITE, SCARLET PIN
WHITE, SCARLET PIPE
WHITE, SCARLET SLEEVE
WHITE,BLACK PIPE
WHITE,NAVY
WHITE,ROYAL PIPE
WHITE,SCARLET
YELLOW

We hope you get an idea about PHP wordwrap Text file to array String to Date Functions
We would like to have feedback on my Information blog .
Your valuable any feedback, Good question, Inspirational Quotes, or Motivational comments about this article are always welcome.
If you liked this post, Please don’t forget to share this as Well as Like FaceBook Page.

We hope This Post can help you…….Good Luck!.