[PHP] Re: sort() - Where did I go wrong?
I'm having a similar problem here if I pass a numeral inside $searchenquiry $searchenquiry = 1.0.1 Retrospective bibliographies and checklists / bibliographies et répertoires rétrospectifs; preg_replace ('/('.$searchenquiry.')/i' , b$1/b, $mydata-RB) error: Unknown modifier 'b' in b/www-html/new1/db/display.table.inc/b on line b103/b -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: sort() - Where did I go wrong?
Ok. This is not a numeral problem? strval did not make a difference. I have, however, solved the immediate problem with: # if((strtolower(substr($enquiry, 0, 1)) == $rbenquiry)) if((strtolower(substr($enquiry, 0, strlen($rbenquiry))) == $rbenquiry)) However, preg_replace ('/('.$searchenquiry.')/i' , b$1/b, $mydata-RB) still gives me: error: Unknown modifier ... $searchenquiry = 1.0.1 Retrospective bibliographies and checklists / bibliographies et répertoires rétrospectifs; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: sort() - Where did I go wrong?
I don't see how these questions are related, please ask each question separately next time. If you want to put variables in your regex's, you must use preg_quote. John Taylor-Johnston [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Ok. This is not a numeral problem? strval did not make a difference. I have, however, solved the immediate problem with: # if((strtolower(substr($enquiry, 0, 1)) == $rbenquiry)) if((strtolower(substr($enquiry, 0, strlen($rbenquiry))) == $rbenquiry)) However, preg_replace ('/('.$searchenquiry.')/i' , b$1/b, $mydata-RB) still gives me: error: Unknown modifier ... $searchenquiry = 1.0.1 Retrospective bibliographies and checklists / bibliographies et répertoires rétrospectifs; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: sort() - Where did I go wrong?
John Taylor-Johnston wrote: I'm having a similar problem here if I pass a numeral inside $searchenquiry $searchenquiry = 1.0.1 Retrospective bibliographies and checklists / bibliographies et répertoires rétrospectifs; preg_replace ('/('.$searchenquiry.')/i' , b$1/b, $mydata-RB) error: Unknown modifier 'b' in b/www-html/new1/db/display.table.inc/b on line b103/b the problem is the slash in $searchenquiry, use preg_quote() -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: sort() - Where did I go wrong?
Like this? td.preg_replace ('/('.preg_quote($searchenquiry).')/i' , b$1/b, $mydata-JR).nbsp;/td Still getting the unknown modifier error. $searchenquiry = 1.0.1 Retrospective bibliographies and checklists / bibliographies et répertoires rétrospectifs; preg_replace ('/('.$searchenquiry.')/i' , b$1/b, $mydata-RB) error: Unknown modifier 'b' in b/www-html/new1/db/display.table.inc/b on line b103/b the problem is the slash in $searchenquiry, use preg_quote() -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: sort() - Where did I go wrong?
John Taylor-Johnston wrote: Like this? td.preg_replace ('/('.preg_quote($searchenquiry).')/i' , b$1/b, $mydata-JR).nbsp;/td Still getting the unknown modifier error. No, like this: preg_quote($searchenquiry, '/') so also the delimiter - /, is quoted $searchenquiry = 1.0.1 Retrospective bibliographies and checklists / bibliographies et répertoires rétrospectifs; preg_replace ('/('.$searchenquiry.')/i' , b$1/b, $mydata-RB) error: Unknown modifier 'b' in b/www-html/new1/db/display.table.inc/b on line b103/b the problem is the slash in $searchenquiry, use preg_quote() -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php