If you are asking as administrator of a Drupal site, you don't need to write PHP code to achieve what you described: Whenever it's a block you created from the UI, or it's a block implemented from a module, you can change for which content types the block is shown.
On admin/structure/block, find the block you want to show only for some content types. (In the following screenshots, I will use the System help block as example.)

Click on the configure link that you find at the right side. You will access the settings for that block.

Click on Content types. You will get the list of content type defined in the site.

As the description says, selecting a content type will make the block appear on the nodes of those content types. Not selecting any content type will make the block appear on every node. (It means, there isn't the need to select every content type to show the block for all the nodes.)
If you are asking for a block implemented by a module you develop, then you can decide when the block is shown, in hook_block_view()
.
function mymodule_block_view($delta = '') {
switch ($delta) {
// Replace 'block_id' with the block identifier.
case 'block_id':
// $node->type is case sensitive; use the exact content type identifier.
if ($node = menu_get_object() && $node->type == 'KYN') {
// Add the block title in $block['subject'],
// the block content in $block['content'], and return $block.
}
break;
}
}
I used menu_get_object()
because it loads the correct node object, even when the page is for a node revision (for example, /node/1/revisions/2/view).
php
to determine a node's content type, then mynode_load()
-less approach on this related question should come in handy: drupal.stackexchange.com/a/238904/10645