This topic is locked

Find value in a string with PHP

12/13/2012 9:54:28 AM
PHPRunner General questions
S
sickacid author

Hi I have a list varchar, for example:
1, 2, 3, 4

2, 3, 4, 5

4, 5, 6, 6
i want to do sth when i find the number 3 in php but my code wont' work.. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=20408&image=1&table=forumtopics' class='bbc_emoticon' alt=':(' />
$finder3 = $values["patenti"]; //get the string

$finder4 = strstr($finder3, '3');

$finder5 == substr($finder4, 0, 1);
if ($write==27 and $finder5 ==3)

...
whre is my mistake? <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=20408&image=2&table=forumtopics' class='bbc_emoticon' alt=':(' />

C
cgphp 12/13/2012
$finder3 = $values["patenti"]; //get the string

$finder4 = strstr($finder3, '3');

if( ! $finder4)

{

//we didn't find the 3 character

}

else

{

$finder5 = (int)$finder4[0];

if ($write == 27)

{
}

}