Reputation:
For example, in the string given below:
$string = "adadadadadadadadaadadadadadadadadadadadadadadadadadadadadadadadadadadadadaddadadadadaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaafewgewrehrejrejreerj";
I would like the output to consist of all the characters except the first 20. How do I achieve this?
Upvotes: 1
Views: 518
Reputation: 47
if you have to only print string then you can direct echo / print . echo "your string";
Upvotes: 0
Reputation: 1050
Here is the code:
$string = "adadadadadadadadaadadadadadadadadadadadadadadadadadadadadadadadadadadadadaddadadadadaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaafewgewrehrejrejreerj";
echo substr($string, 20)
And check output.
Upvotes: 3
Reputation: 115
You can use the substr($string, $start)
You can see the manual here http://php.net/manual/en/function.substr.php
Upvotes: 0
Reputation: 133380
If you need the right part of the string after the 20th character you could use substr
$string = "adadadadadadadadaadadadadadadadadadadadadadadadadadadadadadadadadadadadadaddadadadadaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaafewgewrehrejrejreerj";
$rest = substr($string, 20, -1);
see this for ref http://php.net/manual/en/function.substr.php
Upvotes: 0