I've spent a whole day debugging my code (that was based on the example below, posted by knut) until I found out, that iptcembed() only works if the image specified in jpeg_file_name already has IPTC fields included.
That means that you cannot write IPTC fields in a jpeg file without preexisting IPTC information in it.
Updating of IPTC fields also worked only with a few files, I don't really know what it depends on whether it works or not. (Well, it depends on the IPTC header, that's for sure :-)
I'm using PHP 4.2.1, maybe this is fixed in more recent versions, but I don't believe...
Nevertheless, here's some piece of code I tried:
I replaced the line
<?
$iptc_old = iptcparse ($info["APP13"]);
?>
from knut's example below with
<?
$iptc_old["2#000"][0] = chr(0) . chr(2);
?>
This creates just an empty "Header" according to the IPTC spec. This one also is included when getting IPTC info using iptcparse(). So my intention was to create a fully new header, but when using iptcembed() afterwards, the file size of the new file was a little smaller than the original but without any IPTC info stored in it.