How can I have text within a php variable be bold?? function show_balance_header ($balance, $currency) { (string)$display_output = null; $display_output = fees_main::display_amount(abs($…
Tag: php
How to determine max length of a certain array column?
The array looks like this: Can I determine the longest string length of the 3rd column, without having to iterate over the array? In my example the longest string would be “FooBar” – 6 chars. If the inner array had only the string element, I could do max(array_map(‘strlen’, $arr)…
Fatal error: Call to undefined method mysqli_result::fetch_all()
I have problems with PHP in Ubuntu 10.04. When I try use mysqli_result::fetch_all this error appears: Call to undefined method mysqli_result::fetch_all() However, it works in Windows XP. The Code: I don’t want to use fetch_assoc with a loop because I send the result to another layer for processing. I…
Assign same value to multiple variables at once?
How can I assign the same value for multiple variables in PHP at once ? I have something like: $var_a = ‘A’; $var_b = ‘A’; $same_var = ‘A’; $var_d = ‘A’; $some_var =’A’; In my case, I can’t rename …
preg_match with international characters and accents
I would like to validate a string with a pattern that can only contain letters (including letters with accents). Here is the code I use and it always returns “nok”. I don’t know what I am doing wrong, …
MongoDB shell’s db.stats() in php and python
I can see the statistics from Mongo shell as db.stats() or db.collection_name.stats() How do I view statistics of a database, or of a collection, from PHP and Python. EDIT: I have done it in PHP …
Can I get the value of a private property with Reflection?
It doesn’t seem to work: It gets into the IF loop, and then throws an error: Property privateProperty does not exist 😐 $ref = new ReflectionProperty($obj, ‘privateProperty’) doesn’t work either… The documentation page lists a few constants, including IS_PRIVATE. How can I ever us…
Zip files contain same files but have different hashes?
I have created hundreds of folders and text files using php, I then add them to a zip archive. This all works fine but if I create another zip archive using the same folders and files, the new archive will have a different hash to the first one. This is the same if I use winrar instead of php to
how to install ioncube loader?
I recieved this error: Site error: the file C:wampwwwhtmlnews.php requires the ionCube PHP Loader ioncube_loader_win_5.1.dll to be installed by the site administrator. Then I have obtained the proper file and pasted it in the HTML folder. Nothing has changed. What should I do? Answer You need to download DLL …
Login redirect Issue in post comment area in PHP
If someone wishes to comment on any item e.g. and article or forum item, etc. on my site. It prompts them to login/create account. Is it possible to make sure that when the client logs in it takes them back to the comment they wanted to make? But now it’s going not like this flow. The user not logging i…