arhunter Posted February 25, 2010 Share Posted February 25, 2010 I have three questions to pose.... 1) Can you use an array or pass an array to a function... Example $Returned_Result = AFunction($Var1,$Var2,$Array1(),$Array2()); 2) Can you read inbound data in side a function...Example AFunction($Var1,$Var2,$Array1(),$Array2()){ $Array1[0][0] = $_POST["Var1"]; $Array1[0][1] = $_POST["Var2"]; $Array1[0][2] = $_POST["Var3"]; // Code here $Result = $Value determined by results of Code; return $Result; } 3) Is there a function call simular to stripslashes that will make a url safe to store into a MYSQL data base...example.. $URL = "http://www.domain.com/dir1/~dir2/action=strangecharhere?&var=123&var2=abc&var3=specailchar"; $URL = MysteryFunctionHere($URL); $Restult = StoreUrltoDB($URL); later you can recall the $URL as a AREF link. Hope this isn't the wrong place to ask. New to the system. Link to comment https://forums.phpfreaks.com/topic/193305-newbee-questions-concerning-functions-arrays-_post/ Share on other sites More sharing options...
trq Posted February 25, 2010 Share Posted February 25, 2010 1) Yes. 2) Yes. The $_POST array (amongst others) is global. 3) All variables should be put through mysql_real_escape_string before being used in a database query. Link to comment https://forums.phpfreaks.com/topic/193305-newbee-questions-concerning-functions-arrays-_post/#findComment-1017840 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.