0

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?

Rana Pratap
  • 55
  • 1
  • 9
  • 3
    Possible duplicate of [Explode PHP string by new line](https://stackoverflow.com/questions/3997336/explode-php-string-by-new-line) – Vinh VO Apr 18 '18 at 07:23

1 Answers1

5

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

Alive to die - Anant
  • 70,531
  • 10
  • 51
  • 98