explode or any other way

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    explode or any other way

    $file= ' c/text1text2">text3 ';

    I want to get the c/text1text2 part from above $file

    I've tried with
    explode('"','$file')
    But not worked.

    Any other way or different way of using explode ?

    #2
    Try this script cutting a part from page using explode
    PHP Code:
    function cut($start,$end,$from)
    {
    $s $from;
    $r explode($start$s);
    $x explode($end$r[1]);
    return 
    $x[0];
    }
    $text=cut('c','text2',$file); 

    Comment


      #3
      PHP Code:

      $file
      ' c/text1text2">text3 ';

      $arr explode("\""trim($file));

      //$arr = explode('"', trim($file)); 
      var_dump($arr); 
      <?php unlink('World/Europe/Romania.country'); ?>

      Comment


        #4
        Originally posted by athora View Post
        $file= ' c/text1text2">text3 ';

        I want to get the c/text1text2 part from above $file

        I've tried with
        explode('"','$file')
        But not worked.

        Any other way or different way of using explode ?
        PHP Code:
        $file' c/text1text2">text3  ';
        list(
        $part_one$remaining) = explode('"'$file2);
        echo 
        $part_one;

        $part_one substr($filestrpos('"'$file));
        echo 
        $part_one

        Comment


          #5
          $file = blabla(blabla);
          $xx= array_reverse(explode('example.com',$file));
          $cc = explode('"',$xx<b>[0]</b>);
          echo"$cc[0]";

          I missed [0] in $cc. . .
          Thanks all. . . Sorry for getting your valuable time for simple mistake. .

          Comment


            #6
            <?php
            $file = ' c/text1text2">text3 ';
            echo substr($file, 1, 12);
            ?>


            I'm Proud to be a Sri Lankan!

            Comment

            Working...
            X