This question already has answers here:
Question about strpos: how to get 2nd occurrence of a string?
(15 answers)
Closed 8 years ago.
i haves string such as
andy
**jackie**
rudy
linda
ferry
**jackie**
linda
rudy
ammy
**jackie**
tortia
Is it possible to have it removed everything and get the result only below
**jackie**
tortia
it should be possible with substr
thanks
Yes, you can use substr.
But at first you have to find third occurence of jackie. Maybe this function will be helpful https://stackoverflow.com/a/18589825/2701717
Related
This question already has answers here:
Can hyphens be used in query string values?
(2 answers)
Closed 1 year ago.
Hello to everyone who might read this question.
The question is very basic, can a query string parameter key contain the hiphen (-) char?
I have this url
https://www.example.com/page?uid=83485743jfj4f37gj348&thank-you
Thank you all.
Judging from
https://url.spec.whatwg.org/#application-x-www-form-urlencoded-percent-encode-set
you can use the hypen character without any escaping.
This question already has answers here:
calculate math expression from a string using eval
(10 answers)
Closed 4 years ago.
If i've a string like this
((((((4,50*0,86)*52500*1,0016)+3800)/52500)*2,2046)*1,05)
how can i do the operation for obtaning the total result?
Thank You
Maybe your question is a possible duplicate from calculate-math-expression-from-a-string-using-eval
However
if you need to store this in a variable you can do
$string='((((((4,50*0,86)*52500*1,0016)+3800)/52500)*2,2046)*1,05)';
$response=eval('return '.str_replace(',','.',$string.';'));
print($response);
the output is:
9.14027512736
This question already has answers here:
Get string between two strings
(6 answers)
Closed 6 years ago.
I'm trying to get the string between two specific matches, for example two hashtags.
What I would like to achieve:
input: some text in front ##hi there## some text behind
output: hi there
With /%%(.*)%%/, ##hi there## is returned.
Thanks in advance
You need a look ahead and look behind.
(?<=##).*(?=##)
This will match hi there
https://regex101.com/r/qUR4NR/1
This question already has answers here:
Preg replace to words with hash
(3 answers)
Closed 9 years ago.
I want to select a word that as hash using preg_match in php.
For Example consider this string:
Facebook has re-designed #timeline and it is out in New Zealand
Now I want to select #timeline how to do that, I use this code but it select only #t
preg_match_all("/#[a-zA-Z0-9]/")
Thanks in advance :)
It's currently only set up to select a single character following the #. Try this:
preg_match_all("/#[a-zA-Z0-9]+/")
This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
Converting a number (1, 2, 3) to a string (one, two, three) in PHP
I have a form in which products will be listed out when,i clich total chk box it will be calculated but,it will be integera only,i want this to print in words.
For eg:217 it should print in words two hundred seven only. Hope,this is clear.
Thnx in advance
PEAR's Numbers Words is old, but competent.
The duplicate question seems to answer this quite well, DAFFODIL, have a look there. You will have to have PEAR installed. Easiest way is to try Numbers_Words::toWords(200) and see if that throws up an error.