Jump to content

I need to add characters to a string


refiking

Recommended Posts

Actually, you'll need to use:

 

<?php
$pref = "abc";
$ie = strpos($order,$pref);
IF ($ie === false){
    $new = $pref .= $order;
}
?>

 

If you just use ==, and 'abc' is the first 3 characters, strpos will return a 0 which is == to false, but not === to false.

 

EDIT: Bad code tag.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.