php


PHP strpos not working on substrings?


I am stuck on this and need help...
I have a string like this one: VG412-FR-B5W20X24
I am getting different results when using strpos() in PHP5.6 if I am searching for a single char or a substring:
var_dump(strpos("VG412-FR-B5W20X24","FR")); // output: bool(false)
var_dump(strpos("VG412-FR-B5W20X24","F")); // output: int(13)
note that both F and FR are present in the string but one evaluates as an int with location 13 and the other evaluates to false...
can anyone help or have an idea how I can find the location of the substring?
Works in my PHP 5.5.9 environment.
Try using mb_strpos http://php.net/manual/en/function.mb-strpos.php instead.
If that doesn't work can you attach output from your php -i?

Related Links

getting error report ->Zend_Uri_Http->__construct
Backup MySQL Database without blob data
Showing multiple fields associated with same row
Keeping GET variables from 1 page to anonter
ERROR: mysqli_num_rows() expects parameter 1 to be mysqli_result
Getting the value of a row in CodeIgniter
Laravel resource create model with id
Embedded PHP MySQL delete command breaks with alpha and numeric values
Weird issue with related entity in Doctrine
Wordpress custom taxonomy
Mysqli_fetch_assoc with params instead
Strict Standards: Accessing static property JCache::$_handler as non static
I install XAMPP on ubuntu , i have error opening them know
NULL in WHERE clause
laravel 4 reset password link missing mandatory param
How can I show PHP echo in DIV through jQuery without page refresh

Categories

HOME
clearcase
livecode
applescript
hdfs
biztalk
malware
ipv6
impala
sentry
jpa-criteria
sharepoint-online
susy-sass
mod-wsgi
cellular-network
morris.js
math.js
envoy
infopath2010
android-collapsingtoolbar
creation
dreamfactory
nanogallery
macports
aurelia-cli
iscroll
secure-coding
elasticsearch-aggregation
sendinput
apache-toree
oracle-bmcs
directwrite
head.js
skip-lists
exc-bad-access
htmlspecialchars
portability
ipywidgets
metabase
fuzzer
qtcpsocket
dojo-build
bbc-micro
adjacency-list
flipclock
android-expansion-files
python-cffi
blockquote
ampersand
dbmigrate
innerhtml
sablecc
r.java-file
mfmessagecomposeview
jmenubar
sql-view
notin
donut-chart
examine
android-dialog
popup-blocker
uploading
drawimage
delphi-prism
office-automation
kext
webresponse
downgrade
cassini
twitter-feed
rootkit
webclient.uploaddata

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App