Thanks.  My start with method returns return (!strncmp($val, $sub, 
strlen($sub)); now it was !strcmp(substr($val, 0, strlen($sub), $sub)

From: talk-boun...@lists.nyphp.org [mailto:talk-boun...@lists.nyphp.org] On 
Behalf Of Sasa Rakic - Gmail
Sent: Monday, January 09, 2012 11:55 AM
To: 'NYPHP Talk'
Subject: Re: [nyphp-talk] strcmp

Hi Margaret,

I have used mostly strncmp:

<?php

  $single_keys = array();
  $i = 0;
  $single_keys[$i] = "test";
 $key_prefixes = array();
  $j = 0;
  $key_prefixes[$j] = "test";
  if (strncmp($single_keys[$i], $key_prefixes[$j], strlen($key_prefixes[$j])) 
== 0);
  {
    echo "Same data";
  }

?>

Best regards,
Sasa

From: talk-boun...@lists.nyphp.org [mailto:talk-boun...@lists.nyphp.org] On 
Behalf Of Waldman, Margaret
Sent: Monday, January 09, 2012 5:47 PM
To: 'NYPHP Talk'
Subject: Re: [nyphp-talk] strcmp

I was using (strcmp($single_keys[$i], $key_prefixes[$j]) !== false) before.  
Had to change it to -1.  Looks to be.

From: talk-boun...@lists.nyphp.org [mailto:talk-boun...@lists.nyphp.org] On 
Behalf Of Ap | Alsjeblaft!
Sent: Saturday, January 07, 2012 7:02 PM
To: NYPHP Talk
Subject: Re: [nyphp-talk] strcmp

Hi Margaret,

According to the page 'Migrating from PHP 5.2.x to PHP 5.3.x' at 
http://www.php.net/manual/en/migration53.incompatible.php there were no 
backward incompatible changes made to strcmp(). Are you sure strcmp() is the 
culprit?

Regards,
Mark

--
Alsjeblaft!
webdevelopment
Stuff I've built: wende.nu<http://wende.nu>, sizzer.nl<http://sizzer.nl>, 
happycampermusic.com<http://happycampermusic.com>, 
dazzledkid.com<http://dazzledkid.com/>, 
arthurjussen.nl<http://arthurjussen.nl>, schradinova.nl<http://schradinova.nl>, 
roomeleven.nl<http://roomeleven.nl> & studiopino.nl<http://studiopino.nl>

ap...@alsjeblaft.nl<mailto:ap...@alsjeblaft.nl>
http://www.alsjeblaft.nl/

On Sat, Jan 7, 2012 at 6:40 PM, Waldman, Margaret 
<margaret.wald...@bbdo.com<mailto:margaret.wald...@bbdo.com>> wrote:
strcmp


Please consider the environment before printing this e-mail.

This message and any attachments contain information, which may be confidential 
or privileged. If you are not the intended recipient, please refrain from any 
disclosure, copying, distribution or use of this information. Please be aware 
that such actions are prohibited. If you have received this transmission in 
error, kindly notify us by e-mail to 
helpd...@bbdo.com<mailto:helpd...@bbdo.com>. We appreciate your cooperation.

Please consider the environment before printing this e-mail.

This message and any attachments contain information, which may be confidential 
or privileged. If you are not the intended recipient, please refrain from any 
disclosure, copying, distribution or use of this information. Please be aware 
that such actions are prohibited. If you have received this transmission in 
error, kindly notify us by e-mail to helpd...@bbdo.com. We appreciate your 
cooperation.
_______________________________________________
New York PHP User Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

http://www.nyphp.org/show-participation

Reply via email to