Unless you want to send a form each time they select a checkbox, you can't do this with PHP. PHP is a server-side language - textboxes and checkboxes don't exist to PHP.
If you'd like to use Javascript, however, you would do something like this:
<script type="text/javascript">
function changeBox(newValue) {
document.getElementById('theTextbox').readonly = ((newValue == true) ? false : true);
}
</script><input type="checkbox" onclick="changeBox(this.checked)" /> Enable textbox
<input type="text" name="whatever" id="theTextbox" />
(Untested)
EDIT: Now that I think about it, you might need to change ".readonly" to ".style.readonly" in the JS... I don't remember where the readonly attribute is.