Lokolo Posted May 14, 2007 Share Posted May 14, 2007 I can't figure out how to do it. so if i have this code $count = 5; somefunction($count); echo "$count <br>"; -------------------- somefunction($count) { $count = 1000; } but obviously the echo will print off 5, not 1000, which is what I want. w3schools goes on about the return syntax but that only works when the function is returning 1 value! hope you can help (and understand what I am on about), Lokolo Quote Link to comment https://forums.phpfreaks.com/topic/51376-solved-passing-value-back-through-a-function/ Share on other sites More sharing options...
Lokolo Posted May 14, 2007 Author Share Posted May 14, 2007 Passing by refence is done by putting an & sign in the fucntion define i.e. function(&$variable) { } will pass it back. for anyone that wants to know. Quote Link to comment https://forums.phpfreaks.com/topic/51376-solved-passing-value-back-through-a-function/#findComment-252996 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.