Category id in product

Open catalog/controler/product/product.php

Find first

$product_info = $this->model_catalog_product->getProduct($product_id);

Add after it

$categories = $this->model_catalog_product->getCategories($product_info['product_id']);
if ($categories){
    $categories_info = $this->model_catalog_category->getCategory($categories[0]['category_id']);
    $this->data['category_id'] = $categories_info['category_id'];
}

Open catalog/view/theme/*/template/procuct/product.php

Add this wherever you want

<?php if( in_array($category_id, array("1","2","3"))) {?>
    text..					
<?php } else {?>
	other text..
<?php } ?>