Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. [PHP] functions and variables

[PHP] functions and variables

Scheduled Pinned Locked Moved Web Development
questionphpdata-structurestools
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sam 2006
    wrote on last edited by
    #1

    hello, i have a function on my site that i need changed. how can i "save my changes" to $variable_2 for the whole script to access? i dont want to return an array. [code]function something( $variable ) { global $variable, $variable_2; $variable++; $variable_2++; return $variable; }[/code] thanks in advance, sam kline

    G 1 Reply Last reply
    0
    • S Sam 2006

      hello, i have a function on my site that i need changed. how can i "save my changes" to $variable_2 for the whole script to access? i dont want to return an array. [code]function something( $variable ) { global $variable, $variable_2; $variable++; $variable_2++; return $variable; }[/code] thanks in advance, sam kline

      G Offline
      G Offline
      Ghasrfakhri
      wrote on last edited by
      #2

      Hi If you want use $variable_2 in other pages of your site you most register a session to use session you most call session_start() function then register your session variable like this $_SESSION['variable_2'] = 1234; then you can use $variable_2 in all pages that have session_start() function session_start() most call befor html codes & php functions that have output like echo & print Iman Ghasrfakhri

      H 1 Reply Last reply
      0
      • G Ghasrfakhri

        Hi If you want use $variable_2 in other pages of your site you most register a session to use session you most call session_start() function then register your session variable like this $_SESSION['variable_2'] = 1234; then you can use $variable_2 in all pages that have session_start() function session_start() most call befor html codes & php functions that have output like echo & print Iman Ghasrfakhri

        H Offline
        H Offline
        hiral_shah
        wrote on last edited by
        #3

        Hi, I think session is hard to manage but yet if you can manage it then it is really good.

        -------------------------------------------------------------------------------------------------- Hiral Shah India If you think that my answer is good enough and can be helpful for other then don't forget to vote. :)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups