Reputation: 55
This is my php string --
Advertiser ID\tCompany\tManager\tContact Person\tIM_Skype
Now need to convert it to array based on "\t".
how to achieve this?
Upvotes: 0
Views: 52
Reputation: 72299
1. In case of string have single-quote then using explode()
<?php
$string = 'Advertiser ID\tCompany\tManager\tContact Person\tIM_Skype';
$array = explode('\t',$string);
print_r($array);
Output:-https://eval.in/990122
2. In case of string have double-quote then
<?php
$string = "Advertiser ID\tCompany\tManager\tContact Person\tIM_Skype";
$array = explode("\t",$string);
print_r($array);
Output:- https://eval.in/990131
Upvotes: 5