Location: PHPKode > scripts > floSIP Packet > flosip-packet/sample.php
This sample uses the dBug.php class available on this site (http://www.phpclasses.org/) for array visualization.

$sip = new floSIP_Packet();
if ($_POST["message_text"]) {
if ($_POST["header"] || $_POST["header_value"]) {
	$sip->header_update(stripslashes($_POST["header"]), stripslashes($_POST["header_value"]), stripslashes($_POST["header_where"]));

	<title>floSIP Sample</title>
		* {
			font-family: Arial;
			font-size: 10pt;

if ($sip->parse_error) {

<form action="sample.php" method="post">
SIP Message:<br>
<TEXTAREA name="message_text" rows=25 cols=80><?=str_replace("<", "&lt;", str_replace("&", "&amp;", $sip->message_stream))?></TEXTAREA><br><br>

Update Header:<br>
<input type="text" name="header"> => <input type="text" name="header_value"> <select name="header_where"><option value="0">Add/Replace</option><option value="-1">Insert Above</option><option value="1">Insert Below</option></select> <input type="submit" value="Go">

<br><br>> SIP => The sip header is the whole first line.<br>
> => The blank header is a shortcut for the body when inserting/adding.<br>
All other headers are used as-is.  

$dBug = new dBug($sip->message_array);

Return current item: floSIP Packet