I wanna catch Php classes from a file: and the result matches must be and Answer regexps are poor at parsing programming languages’ grammars. Consider tokenizer functions instead. e.g. http://php.net/manual/en/function.token-get-all.php see also this http://framework.zend.com/apidoc/core/Zend_Reflection…
Tag: php
array replace function not working for me
is there any array replace function in php .. in php manual there is a function called array_replace but its not working… Tell me some example… for array replace.. Answer output the question is: what exactly isnt working for you?
The image cannot be displayed because it contains errors
Why is this code not working ?
PHP unexpected result of float to int type cast
I’trying to convert a float to an int value in php: I can use ceil to make it work but can somebody explain this to me? Answer This is because numbers that have a finite representation in base 10 may or may not have an exact representation in the floating point representation PHP uses. See >php -r &#…
preg_match() and username
Easy one.., i have this, can you explain what it checks for? I know it checks if the username have length between 2-20, what more? Thanks Answer It searches for text containing only alphanumeric and underscore characters, from 2 to 20 characters long. /^[a-zd_]{2,20}$/i |||| | ||| ||| |||| | ||| ||i : case in…
Save Google map to jpeg using PHP?
Is it even possible? I am implementing an export to pdf functionality for a pile of data, one of which is a Google map with a marker. Thank you. Answer I think you are looking for this: http://code.google.com/apis/maps/documentation/staticmaps/ you just need the url and the google api returns the google maps …
Replacing accented characters php
I am trying to replace accented characters with the normal replacements. Below is what I am currently doing. $string = “Éric Cantona”; $strict = strtolower($string); echo “After Lower: “….
How to enforce a http 403 or 404?
Is it possible to kind of force a 403 or 404 error? I have a kind of admin page, where I am trying to prevent hackers from getting into my filesystem on my server. (the path get’s delivered over the …
How to remove numbers from a string with RegEx
I have a string like this: I would like to remove 23 so I’m left with PM or (with space truncated) just PM. Any suggestions? Needs to be in PHP Answer
PHP: Notice: Undefined index where the session variable is defined
I am making a registration system with an e-mail verifier. Your typical “use this code to verify” type of thing. I want a session variable to be stored, so that when people complete their account …