narmi2
asked on
Split string after first character
Dear Experts,
How do I split a string after the first character?
If I have
$mystring = "this is my string"
I want to end up with
$string_one = "t"'
$string_two = "his is my string"'
Thanks
How do I split a string after the first character?
If I have
$mystring = "this is my string"
I want to end up with
$string_one = "t"'
$string_two = "his is my string"'
Thanks
ASKER
What about string_two?
$string_one = "this is my string"
$string_two =substr($string_one,0,1);
$string_two =substr($string_one,0,1);
ASKER
string one should only have "t"
string two should have the full string minus "t" for example "his is my string".
string two should have the full string minus "t" for example "his is my string".
make three strings
$string_one = "this is my string"
$string_two =substr($string_one,0,1);
$stiring_three=substr($str ing_one,1, 16);
$string_one = "this is my string"
$string_two =substr($string_one,0,1);
$stiring_three=substr($str
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
i hope you get the idea...
cheers
cheers
ASKER
The original string was just an example, it can be of any length, so a cannot use the fixed length of 16 to get string three in your example.
$string_1=substr($string,0
echo $string;