I have a question about a String i want to count all the characters in the string. Like if i have a string
JavaScript
x
"Hello world & good morning. The date is 18.05.2016"
Advertisement
Answer
You can try this code.
JavaScript
<?php
$file = "C:UserssinghDesktopTalkative Challengebase_example.txt";
$document = file_get_contents($file);
$return_array = preg_split("/[s,]+/",$document);
echo count($return_array);
echo $document;
?>
Hopefully it will be working fine.