LuaNET, the lua 5.1 api documentation!

Lua-Api

Table

in_table

function in_table ( e, t ) 
 	for _,v in pairs(t) do
		if (v==e) then return true end
	end
	return false
end
Code
method="GET"
if (in_table(method,{'HEAD','GET','POST'})) then
print("YES!")
end
-- YES!


A function which shows compareable behaviour to php's in_array.

Comments

© 2007 DracoBlue :: Valid XHTML, CSS, RSS Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC | SourceNet © 2007, DracoBlue :: Page created in 0.188 seconds with 23 queries.