viarable converting...

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default viarable converting...

    How I can convert variable $one="index.html" into variable
    $two="indexhtml" or $two="index" something without point or only te first
    word . The varabile is a string.


    Grzegorz R Guest

  2. Similar Questions and Discussions

    1. Converting into PDF bug...
      I am trying to convert a file into PDF (a 20 page one) and I keep getting an error message: "unable to convert file" at the end. It seems to be...
    2. Help with xs: converting I32 to int ?
      Hi. <xs newbie warning=on> Compiling my Math-WalshTransform-1.11 on a Fedora5 with gcc 4.1.0 gives me (amongst other stuff which I can fix): In...
    3. Converting .PDF into CF
      Is there a way using Coldfusion MX to convert a .PDF into a web page? I know with the new CF7, there is a cfdocument tag, but I only have CF6.
    4. Converting From PHP
      I'm converting a site from PHP to ColdFusion and need to find a compatible feature as __LINE__ magic variable in php to report the line number...
    5. Converting to PDF
      How do you install Acrobat distiller printer? It does not appear in my printers in XP. Can you give me the EASIEST steps to set up my computer to...
  3. #2

    Default Re: viarable converting...

    There are s lot of ways to do so. Here are a few:

    $one = "index.html";
    $two = explode(".","index.html");
    echo ($two[0]); // "index"
    echo ($two[1]); // "html"
    --------------------------------------- OR
    $one = "index.html";
    $two = str_replace(".","",$one);
    echo $two; // "indexhtml"
    --------------------------------------- OR
    $one = "index.html";
    $pos = strpos($one,".");
    $two = substr($one,0,$pos);
    $three = substr($one,$pos+1);

    and I'm sure there are a lot of other ways :)

    Good Luck!

    Harrie

    Grzegorz R wrote:
    > How I can convert variable $one="index.html" into variable
    > $two="indexhtml" or $two="index" something without point or only te first
    > word . The varabile is a string.
    >
    >
    Harrie Verveer Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139