Any idea what Deprecated: Function split() is deprecated in means

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AllAboutCams
    Femcams.com
    • Jul 2011
    • 12234

    #1

    Any idea what Deprecated: Function split() is deprecated in means

    im getting error
    Deprecated: Function split() is deprecated in

    in this code

    <?php

    $fcontents = join ('', file ($_SERVER['DOCUMENT_ROOT'] . '/banners/banners_468_60.txt'));
    $s_con = split("~",$fcontents);

    $banner_no = rand(0,(count($s_con)-1));
    echo $s_con[$banner_no];
    ?>
    Binance - Blockchain and Crypto Asset Exchange
    Chaturbate make money in cams
  • edgeprod
    Permanently Gone
    • Mar 2004
    • 10019

    #2
    The function split() was deprecated as of PHP 5.3.0 .. its use is not suggested.

    Comment

    • AllAboutCams
      Femcams.com
      • Jul 2011
      • 12234

      #3
      Originally posted by edgeprod
      The function split() was deprecated as of PHP 5.3.0 .. its use is not suggested.
      Great does that mean i need someone to rewrite the code
      Binance - Blockchain and Crypto Asset Exchange
      Chaturbate make money in cams

      Comment

      • edgeprod
        Permanently Gone
        • Mar 2004
        • 10019

        #4
        Sorry, I didn't look who posted this, I know you'll need a bit more handholding:

        Your PHP is configured with E_DEPRECATED, which shows warnings for functions that are suggested to no longer be used. This isn't an appropriate setting for a production server, and whoever configured your site/server didn't do it correctly .. a production server bitching about coding standards isn't ideal.

        If you don't need regular expressions in your split (which it looks like you don't), use explode(). If you do need them, use preg_split(). I'd go with explode() in this case.

        Comment

        • notjoe
          Confirmed User
          • May 2002
          • 5599

          #5
          Don't use that function. If it is depreciated now it is only a matter of time before it is removed from php and will not exist.

          Comment

          • edgeprod
            Permanently Gone
            • Mar 2004
            • 10019

            #6
            Interestingly, join() isn't common usage. implode() is more common, at least for me, which implies that it is the opposite of explode(), versus the opposite of split() -- which it is NOT.

            join() is just an alias for implode() .. so if you use implode(), it's more clear to use explode() to take it apart.

            Comment

            • AllAboutCams
              Femcams.com
              • Jul 2011
              • 12234

              #7
              Originally posted by edgeprod
              Sorry, I didn't look who posted this, I know you'll need a bit more handholding:

              Your PHP is configured with E_DEPRECATED, which shows warnings for functions that are suggested to no longer be used. This isn't an appropriate setting for a production server, and whoever configured your site/server didn't do it correctly .. a production server bitching about coding standards isn't ideal.

              If you don't need regular expressions in your split (which it looks like you don't), use explode(). If you do need them, use preg_split(). I'd go with explode() in this case.
              Thank you explode worked great
              Binance - Blockchain and Crypto Asset Exchange
              Chaturbate make money in cams

              Comment

              • edgeprod
                Permanently Gone
                • Mar 2004
                • 10019

                #8
                Originally posted by AllAboutCams
                Thank you explode worked great
                Sure. Bitcoin tips accepted.

                Comment

                • AllAboutCams
                  Femcams.com
                  • Jul 2011
                  • 12234

                  #9
                  Originally posted by edgeprod
                  Sure. Bitcoin tips accepted.
                  send me your bitcoin/litecoin address
                  Binance - Blockchain and Crypto Asset Exchange
                  Chaturbate make money in cams

                  Comment

                  • edgeprod
                    Permanently Gone
                    • Mar 2004
                    • 10019

                    #10
                    Originally posted by AllAboutCams
                    send me your bitcoin/litecoin address
                    Primary tipping address is: 1BLgmNjaQadASUADbTYGJKvmtqX9iniHqn

                    Comment

                    • AllAboutCams
                      Femcams.com
                      • Jul 2011
                      • 12234

                      #11
                      Originally posted by edgeprod
                      Primary tipping address is: 1BLgmNjaQadASUADbTYGJKvmtqX9iniHqn

                      Sent what i had left in btc-e thanks a lot for the help
                      Binance - Blockchain and Crypto Asset Exchange
                      Chaturbate make money in cams

                      Comment

                      • edgeprod
                        Permanently Gone
                        • Mar 2004
                        • 10019

                        #12
                        Originally posted by AllAboutCams
                        Sent what i had left in btc-e thanks a lot for the help
                        Appreciated, and you're welcome.

                        Comment

                        Working...