The php Function pg_field_Type_Oid
The php function pg_field_type_oid returns the OID of the base type for a given field in a PostgreSQL query result resource returned by pg_query(), pg_query_params() or pg_execute() (among others). This is distinct from the name of a domain used in a field and is useful when using PostgreSQL's format_type(3) function to convert a domain OID into an SQL standard type name.
Tip: In addition to variables, information can be passed to a php function through arguments. Like variables, arguments are specified after the function name inside parentheses.
A very important feature of php is that variables can be scoped within a function or across multiple functions. To scope a variable, simply place the global keyword in front of the variable. This makes the variable visible both within the function and outside of the function. This can help keep code clean and more readable. For more info on scoping, see the article here.