You're using both unserialize and PHP mildly wrong:
<?php
define("my_const_arr", serialize(array("page_ids" => array("1234", "4123"))));
$page_id = "4123";
$a=unserialize(my_const_arr); // you need to usnerialize it before you can search for a specific key
if(in_array($page_id, $a["page_ids"])): ?>
<h1>Hello Stackoverflow</h1>
<?php endif; ?>
I would also like to point out that constants aren't particularly useful in an application you can control. Especially if that code is very relevant to your app.
<?php
$_myConstArr=array("page_ids" => array("1234", "4123"));
$page_id = "4123";
if(in_array($page_id, $_myConstArr["page_ids"])): ?>
<h1>Hello Stackoverflow</h1>
<?php endif; ?>
You will not get much overhead by doing this. I'd think that calling serialize/unserialize often would give you unwanted processing.
Post your exact scenario and a better solution might be made available.