I'm using PHP and the str_replace function to replace (in this case remove) some code from within an RTF file. It replaces some blocks of code in the RTF file fine, but others do not replace and I cant tell why.
I'm trying to use this function to remove paragraphs from an RTF file:
$document = str_replace('CODE-TO-REMOVE-GOES-HERE', '', $document);
This code works fine:
$document = str_replace('\par }\pard\plain \ltrpar\qc \li0i0\sl480\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustrightin0\lin0\itap0\pararsid5841714 tlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
tlch\fcs1 \ab\af0\afs24 \ltrch\fcs0 \b\f0\fs24\insrsid5841714\charrsid5841714 BOLDED CENTERED HEADING}{tlch\fcs1 \ab\af0\afs24 \ltrch\fcs0 \b\f0\fs24\insrsid5841714 ', '', $document);
but for some reason this section does not:
$document = str_replace('\par {\listtext\pard\plain\ltrpar \s15 tlch\fcs1 \af0 \ltrch\fcs0 \insrsid5841714 \hich\af0\dbch\af0\loch\f0 5.\tab}}\pard\plain \ltrpar\s15\ql \fi720\li0i0\sl480\slmult1
\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustrightin0\lin0\itap0\pararsid3021950\contextualspace tlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {tlch\fcs1 \af0\afs24 \ltrch\fcs0
\f0\fs24\insrsid5841714 This text in the paragraph open(s) non-broken put(s) this is additional sample text that will not remove (CPL \'a7\'a7
100.00[1][x]; 100.23[3])', '', $document);
The first block of code (removing the BOLDED CENTERED HEADING) works fine and removes that line RTF, but the second block, which is trying to remove the paragraph directly below the BOLDED CENTERED HEADING, doesn't remove or seem to do anything.
Can anyone spot the difference between these two that is causing one to replace but not the other?
Edit/Update:
all the files (rtf, html, php) are encoded in UTF-8 (according to Notepad++). php.ini has default_charset = "UTF-8"
and .htaccess has AddDefaultCharset UTF-8
Here is the entire PHP file at this point. It's only a test to see if this was possible. It takes inputs from a form and inserts them into the RTF, but also tries to remove some paragraphs - which is the part I'm failing at. I'm starting to think it has something to do with the parentheses.
<?php
header('Content-Type: text/html; charset=UTF-8');
mb_internal_encoding('UTF-8');
mb_http_output('UTF-8');
mb_http_input('UTF-8');
mb_regex_encoding('UTF-8');
if (isset($_POST['prp'])){
$document = file_get_contents("city-omnibus-template.rtf");
$defendantphp = $_POST['defendanthtml'];
$judgephp = $_POST['judgehtml'];
$crnumphp = $_POST['crnumhtml'];
$adaphp = $_POST['adahtml'];
$attyphp = $_POST['attyhtml'];
$motargdatephp = $_POST['motargdatehtml'];
$deftodisphp = $_POST['deftodishtml'];
$crimedatephp = $_POST['crimedatehtml'];
$motsigndatephp = $_POST['motsigndatehtml'];
$accusdatephp = $_POST['accusdatehtml'];
$allcrimeschargedphp = $_POST['allcrimeschargedhtml'];
if (empty($fax)){
$fax='-';
}
$document = str_replace("#defendantword", $defendantphp, $document);
$document = str_replace("#judgeword", $judgephp, $document);
$document = str_replace("#crnumword", $crnumphp, $document);
$document = str_replace("#adaword", $adaphp, $document);
$document = str_replace("#attyword", $attyphp, $document);
$document = str_replace("#motargdateword", $motargdatephp, $document);
$document = str_replace("#deftodisword", $deftodisphp, $document);
$document = str_replace("#crimedateword", $crimedatephp, $document);
$document = str_replace("#motargdateword", $motsigndatephp, $document);
$document = str_replace("#accusdateword", $accusdatephp, $document);
$document = str_replace("#allcrimeschargedword", $allcrimeschargedphp, $document);
// this one works
$document = str_replace('\par }\pard\plain \ltrpar\qc \li0i0\sl480\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustrightin0\lin0\itap0\pararsid5841714 tlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
tlch\fcs1 \ab\af0\afs24 \ltrch\fcs0 \b\f0\fs24\insrsid5841714\charrsid5841714 PROSECUTION BY INFORMATION}{tlch\fcs1 \ab\af0\afs24 \ltrch\fcs0 \b\f0\fs24\insrsid5841714 ', '', $document);
//this one does not
$document = str_replace('\par {\listtext\pard\plain\ltrpar \s15 tlch\fcs1 \af0 \ltrch\fcs0 \insrsid5841714 \hich\af0\dbch\af0\loch\f0 5.\tab}}\pard\plain \ltrpar\s15\ql \fi720\li0i0\sl480\slmult1
\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustrightin0\lin0\itap0\pararsid3021950\contextualspace tlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {tlch\fcs1 \af0\afs24 \ltrch\fcs0
\f0\fs24\insrsid5841714 The defendant has entered a plea of not guilty to the charge(s) alleged in the accusatory instrument. To the extent that any of
the pending non-felony charge(s) are based upon a hearsay complaint, rather than a non-hearsay information, the defendant hereby refuses to consent to be prosecuted by such complaint and demands to be prosecuted by a non-hearsay information (CPL \'a7\'a7
170.10[4][d]; 170.65[1])', '', $document);
header("Content-type: application/msword");
header("Content-disposition: inline; filename=$defendantphp-Omnibus.doc");
header("Content-length: ".strlen($document));
echo iconv('UTF-8', 'ISO-8859-1', $document);
}
?>
Link to RTF file: https://drive.google.com/open?id=11sH7RnpuQ1YJq8GFnhclN8kxxBB_SIlo
More edits:
Workaround - this is probably a terrible way of doing it, but it seems like it works if I remove the parentheses ( ) and section symbol § (replacing it in the RTF with some stand in code like ##118##) - and then doing another str_replace to change the (unremoved) stand in code back to a parentheses or section symbol. But if there's a better way I'm still looking for it.
Significant Progress Made - one part still not working Everything is working except for this last section which won't replace. The only thing I can tell is any different about it is that it has a nested list, but I don't know why that would matter.
Here's the chunk that won't replace:
$search3 = <<<'EOL'
\par }\pard\plain \ltrpar\qc \li0i0\sl480\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustrightin0\lin0\itap0\pararsid5841714 tlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
tlch\fcs1 \ab\af0\afs24 \ltrch\fcs0 \b\f0\fs24\insrsid5841714\charrsid5841714 DEFECTIVE INFORMATION}{tlch\fcs1 \ab\af0\afs24 \ltrch\fcs0 \b\f0\fs24\insrsid5841714
\par {\listtext\pard\plain\ltrpar \s15 tlch\fcs1 \af0 \ltrch\fcs0 \insrsid5841714 \hich\af0\dbch\af0\loch\f0 6.\tab}}\pard\plain \ltrpar\s15\ql \fi720\li0i0\sl480\slmult1
\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustrightin0\lin0\itap0\pararsid3021950\contextualspace tlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {tlch\fcs1 \af0\afs24 \ltrch\fcs0
\f0\fs24\insrsid5841714 The defendant hereby moves, pursuant to CPL }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 \'a7}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid5841714 170.30}{tlch\fcs1 \af0\afs24 \ltrch\fcs0
\f0\fs24\insrsid3021950 , to dismiss the accusatory or count charging the offense}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 (}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid3021950 s}{tlch\fcs1 \af0\afs24 \ltrch\fcs0
\f0\fs24\insrsid14111911 )}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid3021950 of }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13307306 #deftodisword on the ground that it is defective. An accusatory instrument }{tlch\fcs1 \af0\afs24
\ltrch\fcs0 \f0\fs24\insrsid14111911 (}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13307306 or count thereof}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 )}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13307306
is defective if it is not sufficient on itquote s face pursuant to the requirements of CPL }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 \'a7}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13307306 100.40 }{tlch\fcs1 \af0\afs24
\ltrch\fcs0 \f0\fs24\insrsid14111911 (}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13307306 CPL }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 \'a7}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13307306 170.35[1][a]}{
tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 )}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13307306 ;}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid5841714
\par {\listtext\pard\plain\ltrpar \s15 tlch\fcs1 \af0 \ltrch\fcs0 \insrsid13307306 \hich\af0\dbch\af0\loch\f0 7.\tab}}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13307306
To be sufficient on its face, a local criminal court accusatory which purports to qualify as an \'93information\'94 must satisfy the requirements set forth below:
\par {\listtext\pard\plain\ltrpar \s15 tlch\fcs1 \af0 \ltrch\fcs0 \insrsid13307306 \hich\af0\dbch\af0\loch\f0 a.\tab}}\pard \ltrpar
\s15\ql \fi-360\li1440i0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls2\ilvl1\adjustrightin0\lin1440\itap0\pararsid13446461\contextualspace {tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13307306 An information \'93
must contain an accusatory part and a factual part. The complainantquote s verification of the instrument is deemed to apply only to the }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461 factual part thereof and not to the accusatory part.
\'94 }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 (}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461 CPL }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 \'a7}{tlch\fcs1 \af0\afs24 \ltrch\fcs0
\f0\fs24\insrsid13446461 100.15[1]}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 )}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461 ;\line }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13307306
\par {\listtext\pard\plain\ltrpar \s15 tlch\fcs1 \af0 \ltrch\fcs0 \insrsid13446461 \hich\af0\dbch\af0\loch\f0 b.\tab}}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461 The accusatory part \'93must designate the offense or offenses charged\'94 }{
tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 (}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461 CPL }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 \'a7}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461
100.15[2]}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 )}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461 ;\line
\par {\listtext\pard\plain\ltrpar \s15 tlch\fcs1 \af0 \ltrch\fcs0 \insrsid13446461 \hich\af0\dbch\af0\loch\f0 c.\tab}The factual part \'93
must contain a statement of the complainant alleging facts of an evidentiary character supporting or tending to support the charges\'94 }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 (}{tlch\fcs1 \af0\afs24 \ltrch\fcs0
\f0\fs24\insrsid13446461 CPL }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 \'a7}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461 100.15[3]; see also }{tlch\fcs1 \ai\af0\afs24 \ltrch\fcs0
\i\f0\fs24\insrsid13446461\charrsid13446461 People v. Dumas}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461 , 68 NY2d [1986]}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 )}{tlch\fcs1 \af0\afs24 \ltrch\fcs0
\f0\fs24\insrsid13446461 ;\line
\par {\listtext\pard\plain\ltrpar \s15 tlch\fcs1 \af0 \ltrch\fcs0 \insrsid13446461 \hich\af0\dbch\af0\loch\f0 d.\tab}The allegations of the factual part, together with those of any supporting depositions which may accompany it, must \'93
provide reasonable cause to believe that the defendant committed the offense charged in the accusatory part of the information\'94 }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 (}{tlch\fcs1 \af0\afs24 \ltrch\fcs0
\f0\fs24\insrsid13446461 CPL }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 \'a7}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461 100.40[1][b]}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 )}{tlch\fcs1
\af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461 ;\line
\par {\listtext\pard\plain\ltrpar \s15 tlch\fcs1 \af0 \ltrch\fcs0 \insrsid13446461 \hich\af0\dbch\af0\loch\f0 e.\tab}Finally, every element of the offense charged and the defendantquote s commission thereof must be established by \'93
non-hearsay allegations of the factual part of the information and/or of any supporting depositions\'94 }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 (}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461 CPL }{tlch\fcs1
\af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 \'a7}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461 100.40[1][c]; }{tlch\fcs1 \ai\af0\afs24 \ltrch\fcs0 \i\f0\fs24\insrsid13446461\charrsid13446461 see also People v. Alejandro}{tlch\fcs1
\af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461 , 70 NY2d 133 [1987]}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 )}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461 .
\par }\pard\plain \ltrpar\ql \li0i0\sl480\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustrightin0\lin0\itap0\pararsid13446461 tlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461
EOL;
$document = str_replace($search3, '', $document);
And here's the updated version of the PHP with fyrye's fixes included:
<?php
header('Content-Type: text/html; charset=UTF-8');
if (isset($_POST['prp'])){
$document = file_get_contents("city-omnibus-template.rtf");
// not sure what this does - changes all line endings?
$document = str_replace(["
", "
"], ["
", "
"], $document);
$defendantphp = $_POST['defendanthtml'];
$judgephp = $_POST['judgehtml'];
$crnumphp = $_POST['crnumhtml'];
$adaphp = $_POST['adahtml'];
$attyphp = $_POST['attyhtml'];
$motargdatephp = $_POST['motargdatehtml'];
$deftodisphp = $_POST['deftodishtml'];
$crimedatephp = $_POST['crimedatehtml'];
$motsigndatephp = $_POST['motsigndatehtml'];
$accusdatephp = $_POST['accusdatehtml'];
$allcrimeschargedphp = $_POST['allcrimeschargedhtml'];
if (empty($fax)){
$fax='-';
}
$document = str_replace("#defendantword", $defendantphp, $document);
$document = str_replace("#judgeword", $judgephp, $document);
$document = str_replace("#crnumword", $crnumphp, $document);
$document = str_replace("#adaword", $adaphp, $document);
$document = str_replace("#attyword", $attyphp, $document);
$document = str_replace("#motargdateword", $motargdatephp, $document);
$document = str_replace("#deftodisword", $deftodisphp, $document);
$document = str_replace("#crimedateword", $crimedatephp, $document);
$document = str_replace("#motargdateword", $motsigndatephp, $document);
$document = str_replace("#accusdateword", $accusdatephp, $document);
$document = str_replace("#allcrimeschargedword", $allcrimeschargedphp, $document);
// this one is working now
$search1 = <<<'EOL'
\par }\pard\plain \ltrpar\qc \li0i0\sl480\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustrightin0\lin0\itap0\pararsid5841714 tlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
tlch\fcs1 \ab\af0\afs24 \ltrch\fcs0 \b\f0\fs24\insrsid5841714\charrsid5841714 PROSECUTION BY INFORMATION}{tlch\fcs1 \ab\af0\afs24 \ltrch\fcs0 \b\f0\fs24\insrsid5841714
EOL;
$document = str_replace($search1, '', $document);
// this one is also working now - thanks fyrye
$search2 = <<<'EOL'
\par {\listtext\pard\plain\ltrpar \s15 tlch\fcs1 \af0 \ltrch\fcs0 \insrsid5841714 \hich\af0\dbch\af0\loch\f0 5.\tab}}\pard\plain \ltrpar\s15\ql \fi720\li0i0\sl480\slmult1
\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustrightin0\lin0\itap0\pararsid3021950\contextualspace tlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {tlch\fcs1 \af0\afs24 \ltrch\fcs0
\f0\fs24\insrsid5841714 The defendant has entered a plea of not guilty to the charge}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 (}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid5841714 s}{tlch\fcs1 \af0\afs24 \ltrch\fcs0
\f0\fs24\insrsid14111911 )}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid5841714 alleged in the accusatory instrument. To the extent that any of the pending non-felony charge}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 (}{
tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid5841714 s}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 )}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid5841714
are based upon a hearsay complaint, rather than a non-hearsay information, the defendant hereby refuses to consent to be prosecuted by such complaint and demands to be prosecuted by a non-hearsay information }{tlch\fcs1 \af0\afs24 \ltrch\fcs0
\f0\fs24\insrsid14111911 (}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid5841714 CPL }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 \'a7\'a7}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid5841714 170.10[4][d]; 170.65[1]}{
tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 )}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid5841714
EOL;
$document = str_replace($search2, '', $document);
// leaving this in even though it doesn't seem to make a difference
$search3 = str_replace(["
", "
"], ["
", "
"], $search3);
// This one still not replacing - most complicated
$search3 = <<<'EOL'
\par }\pard\plain \ltrpar\qc \li0i0\sl480\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustrightin0\lin0\itap0\pararsid5841714 tlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
tlch\fcs1 \ab\af0\afs24 \ltrch\fcs0 \b\f0\fs24\insrsid5841714\charrsid5841714 DEFECTIVE INFORMATION}{tlch\fcs1 \ab\af0\afs24 \ltrch\fcs0 \b\f0\fs24\insrsid5841714
\par {\listtext\pard\plain\ltrpar \s15 tlch\fcs1 \af0 \ltrch\fcs0 \insrsid5841714 \hich\af0\dbch\af0\loch\f0 6.\tab}}\pard\plain \ltrpar\s15\ql \fi720\li0i0\sl480\slmult1
\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustrightin0\lin0\itap0\pararsid3021950\contextualspace tlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {tlch\fcs1 \af0\afs24 \ltrch\fcs0
\f0\fs24\insrsid5841714 The defendant hereby moves, pursuant to CPL }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 \'a7}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid5841714 170.30}{tlch\fcs1 \af0\afs24 \ltrch\fcs0
\f0\fs24\insrsid3021950 , to dismiss the accusatory or count charging the offense}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 (}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid3021950 s}{tlch\fcs1 \af0\afs24 \ltrch\fcs0
\f0\fs24\insrsid14111911 )}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid3021950 of }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13307306 #deftodisword on the ground that it is defective. An accusatory instrument }{tlch\fcs1 \af0\afs24
\ltrch\fcs0 \f0\fs24\insrsid14111911 (}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13307306 or count thereof}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 )}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13307306
is defective if it is not sufficient on itquote s face pursuant to the requirements of CPL }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 \'a7}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13307306 100.40 }{tlch\fcs1 \af0\afs24
\ltrch\fcs0 \f0\fs24\insrsid14111911 (}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13307306 CPL }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 \'a7}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13307306 170.35[1][a]}{
tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 )}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13307306 ;}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid5841714
\par {\listtext\pard\plain\ltrpar \s15 tlch\fcs1 \af0 \ltrch\fcs0 \insrsid13307306 \hich\af0\dbch\af0\loch\f0 7.\tab}}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13307306
To be sufficient on its face, a local criminal court accusatory which purports to qualify as an \'93information\'94 must satisfy the requirements set forth below:
\par {\listtext\pard\plain\ltrpar \s15 tlch\fcs1 \af0 \ltrch\fcs0 \insrsid13307306 \hich\af0\dbch\af0\loch\f0 a.\tab}}\pard \ltrpar
\s15\ql \fi-360\li1440i0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls2\ilvl1\adjustrightin0\lin1440\itap0\pararsid13446461\contextualspace {tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13307306 An information \'93
must contain an accusatory part and a factual part. The complainantquote s verification of the instrument is deemed to apply only to the }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461 factual part thereof and not to the accusatory part.
\'94 }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 (}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461 CPL }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 \'a7}{tlch\fcs1 \af0\afs24 \ltrch\fcs0
\f0\fs24\insrsid13446461 100.15[1]}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 )}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461 ;\line }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13307306
\par {\listtext\pard\plain\ltrpar \s15 tlch\fcs1 \af0 \ltrch\fcs0 \insrsid13446461 \hich\af0\dbch\af0\loch\f0 b.\tab}}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461 The accusatory part \'93must designate the offense or offenses charged\'94 }{
tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 (}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461 CPL }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 \'a7}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461
100.15[2]}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 )}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461 ;\line
\par {\listtext\pard\plain\ltrpar \s15 tlch\fcs1 \af0 \ltrch\fcs0 \insrsid13446461 \hich\af0\dbch\af0\loch\f0 c.\tab}The factual part \'93
must contain a statement of the complainant alleging facts of an evidentiary character supporting or tending to support the charges\'94 }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 (}{tlch\fcs1 \af0\afs24 \ltrch\fcs0
\f0\fs24\insrsid13446461 CPL }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 \'a7}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461 100.15[3]; see also }{tlch\fcs1 \ai\af0\afs24 \ltrch\fcs0
\i\f0\fs24\insrsid13446461\charrsid13446461 People v. Dumas}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461 , 68 NY2d [1986]}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 )}{tlch\fcs1 \af0\afs24 \ltrch\fcs0
\f0\fs24\insrsid13446461 ;\line
\par {\listtext\pard\plain\ltrpar \s15 tlch\fcs1 \af0 \ltrch\fcs0 \insrsid13446461 \hich\af0\dbch\af0\loch\f0 d.\tab}The allegations of the factual part, together with those of any supporting depositions which may accompany it, must \'93
provide reasonable cause to believe that the defendant committed the offense charged in the accusatory part of the information\'94 }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 (}{tlch\fcs1 \af0\afs24 \ltrch\fcs0
\f0\fs24\insrsid13446461 CPL }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 \'a7}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461 100.40[1][b]}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 )}{tlch\fcs1
\af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461 ;\line
\par {\listtext\pard\plain\ltrpar \s15 tlch\fcs1 \af0 \ltrch\fcs0 \insrsid13446461 \hich\af0\dbch\af0\loch\f0 e.\tab}Finally, every element of the offense charged and the defendantquote s commission thereof must be established by \'93
non-hearsay allegations of the factual part of the information and/or of any supporting depositions\'94 }{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 (}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461 CPL }{tlch\fcs1
\af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 \'a7}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461 100.40[1][c]; }{tlch\fcs1 \ai\af0\afs24 \ltrch\fcs0 \i\f0\fs24\insrsid13446461\charrsid13446461 see also People v. Alejandro}{tlch\fcs1
\af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461 , 70 NY2d 133 [1987]}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid14111911 )}{tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461 .
\par }\pard\plain \ltrpar\ql \li0i0\sl480\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustrightin0\lin0\itap0\pararsid13446461 tlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {
tlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13446461
EOL;
$document = str_replace($search3, '', $document);
header("Content-type: application/msword");
header("Content-disposition: inline; filename=$defendantphp-Omnibus.doc");
echo ($document);
}
?>