Jump to content

[SOLVED] substr()


woolyg

Recommended Posts

I've just tried it like this:

<?php
$string = "My Name is (WOOLYG)";
$name = substr($name,strpos($string,"(")+1,(strlen($name)-strpos(strpos($string,"(")-1)));
echo $name;
?>

 

and am getting...

 

Warning: Wrong parameter count for strpos() in C:\Program Files\Abyss Web Server\htdocs\tests\stringmatch.php on line 3

 

the code was missing 1 bracket at the end.

Link to comment
https://forums.phpfreaks.com/topic/117991-solved-substr/#findComment-607022
Share on other sites

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.