Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Improve this question
I'm a very beginner PHP programmer.
I want to create a search function for the first time, as well as an email verification by myself. I learned a little about regular expressions in Java, but I don't know how exactly to use them in PHP.
For example, how would I use the example "\\w{3,}#\\w{2,}\.\\ w{2,}? (and, are there errors in this code?) It is very simple and not very secure, as it is just a test site.
In Java, I can use Pattern.compile() and pattern.matcher() and matcher.find() to find matches. What is the PHP equivalent?
I've searched around a little bit - they all give examples on how to create good regular expressions, but I don't know what the syntax is for utilizing them.
Could somebody explain this to me, or redirect me to a useful site?
Thanks in advance.
Here is the function that you are probably looking for. Returns a boolean.
http://php.net/manual/en/function.preg-match.php
http://www.php.net/manual/en/ref.pcre.php
The manual is always a good place to start.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
One question, can someone give a website for test PHP code?
I'm looking for some as http://fiddle.jshell.net/ but for PHP.
Someone can help me?
Thanks ^^
Here, some page maybe usefull for you.
http://writecodeonline.com/php/
http://phptester.net/
Here is another one you can try :
http://sandbox.onlinephpfunctions.com/
You could try PHP Fiddle for this kind of thing.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
Well, I recently have been trying to come with code to create matrix in which word hunting can be done. I want the user to initialise rows, columns and of course give the words, it is too difficult to create such code/algorithm as the words can be placed vertically, horizontally or diagonally. I also tried google for such algorithms but without any luck. So, if anyone has an algorthm in mind or has written such PHP code, itll be really great if I can see that.
Thanks in Advance,
Nalin Bhardwaj
I am so sorry , I posted this question here, as suggested by one of the users, I googled a few different things online an dhave found a ruby file which has been built for the same purpose. And , if anybody would like to access it, they may check it out online at http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/298382 . And, now I have decided to use this algorithm itself to create such a PHP file. Thank you everybody, for suggestions
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
Does anyone know of a lemmatizer in PHP? Or, at worst, some way to use a lemmatizer in another language (python NLTK, for instance?) in a PHP webapp?
I'm building a macro-etymological analyzer and I've encountered this issue where the etymological database doesn't contain conjugated words. A lemmatizer would correct this, I think, by giving me the word "say" when the dictionary can't find "said," and returning "good" when the dictionary can't find "better," etc.
Note: a stemmer wouldn't do the same thing as a lemmatizer.
Does this help?
http://tartarus.org/~martin/PorterStemmer/php.txt
It's a PHP5 implementation of the Porter Stemmer algorithm.
i googled this:
http://pastebin.com/WNvb2zB4
and this.
http://tartarus.org/~martin/PorterStemmer/php.txt
dunno if any of them works.
Isn't a https://github.com/heromantor/phpmorphy is what you looking for?
Lemmatisation is relatively more complicated as compare to stemming, that is why it's harder to find some ready and free solution.
I see nobody answered the sub question.
some way to use a lemmatizer in another language (python NLTK, for instance?) in a PHP webapp
The php has at least exec and calls alike. One can simply run any external script or app.
there are some "lemmatizers" in php that could be found in internet, but at a quick check these are turn to be are "stemmers".
Make sure, Stemming won't do for you. Make sure the solution you already have in mind in other language is a Lemmatizer.
I suspect all solution that close to this naming would be in C-like languages. In case those are Open source or provided as libs you could build them into PHP as an extension.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I have done a lot of research, and found nothing, but does anyone know of a spell checker API?
So when you send a request to http://spellcheck.com?spellcheck-api=this is a sentnse, and it returns this is a sentence.
Please, tell me how to make my question better in the comments without downgrading, I'll fix it as fast as possible. I am a new SO member.
Check this awesome script: http://www.phpspellcheck.com
What you practically do is just fetch your $_GET['spellcheck_api'] (convert %20's if needed to spaces). And let the script (include() or require()) handle check your string for spelling errors.
Good luck !
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Improve this question
Does anyone knows where to find a site that has a code comparison of php and classic asp? some sort of cheat sheet comparison guide. I need to convert a php site to classic asp.
please advise.
Thanks.
ASP is a framework so there is no direct comparison to PHP which is a language. ASP does support vbscript and javascript languages.
Here is a comparison to vbscript/javascript/PHP languages
http://phplens.com/phpeverywhere/node/view/30
Have you tried this?
http://www.me-u.com/php-asp/conversionnotes.htm
It obviously has some limitations, but I hope it helps.
Cheers!