Which OS does the server have? Do you want the number of physical cores or logical cores?
Only way I can think of doing this would be to use the execution commands (see: [man]exec[/man]) to execute a system command that contains that info. Depending upon the OS on the server, there's a couple of ways to get that info.
EDIT: Forgot to mention, on Windows servers you could probably use $_ENV['NUMBER_OF_PROCESSORS'] to get the number of logical cores.