PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I'm confused as to why the following code returns the results that it does. Are there some nuances of the in_array function that prevent this from working as expected?
Number one, example.com resolves to 192.0.32.10 not 1.2.3.4
Secondly, dns_get_record() is returning a multi-dimensional array, so this is what it needs to be (in array only looks in the array, not deeper dimensions of that array):
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Oh sure...that makes perfect sense; not sure how I overlooked that (the mulitdimensional array, not the IP - 1.2.3.4 isn't what I'm actually testing against, nor is example.com really what I'm using, as I'm sure you know).
atyler wrote:Oh sure...that makes perfect sense; not sure how I overlooked that (the mulitdimensional array, not the IP - 1.2.3.4 isn't what I'm actually testing against, nor is example.com really what I'm using, as I'm sure you know).
Thanks for the help!
Yes I knew that, hence the smilie
If all you're ever going to do is get an A record, then gethostbyname() might be more portable.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.