I’m trying to insert a space after each semi-colon, unless the semi-colon is part of an HTML entity. The examples here are short, but my strings can be quite long, with several semi-colons (or none). I found the following regular expression that does the trick for short strings: However, if the string i…
Tag: php
CListView in Yii Framework
I have started working on yii framework and I am following the yii blog tutorial to learn basics of yii framework in this tutorial they have used a ClistView in posts view but i am getting an exception This is the code that i have used in view file: This is what my PostsController contains: I can’t find…
PHP “Exception not found”
I have a somehow funny issue. While trying to understand why a certain website returns http code 500 to browser, I found the message PHP Fatal error: Class ‘MZ\MailChimpBundle\Services\Exception’ …
PHP Get name of current directory
I have a php page inside a folder on my website. I need to add the name of the current directory into a variable for example: $myVar = current_directory_name; Is this possible?
PHP Imagick memory leak
I have to render something with Imagick on PHP CLI. I have noticed that every 3-5 days the server memory gets full, so i can’t even connet via ssh or ftp. with memory_get_usage() i narrwoed the memory leak down to the imagick part of the script. the script looks something like this: I destroy the image …
How to ignore fields when fetching results using Propel?
I need to ignore fields instead of select fields in fetch data or reverse select fields. Is that possible? If yes, how? Answer Regarding to the documentation, it’s not possible: http://propelorm.org/reference/model-criteria.html#getting-columns-instead-of-objects But you can do it on your own. Built an …
Phpmyadmin export VIEW without DATABASE_NAME or ALGORITHM
When exporting a sql dump with phpmyadmin it creates the VIEW table like this: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `database`.`table` etc.. Each time I …
can not access to database in moodle
I am using moodle and I change location of my web site, but I am facing this error. My config.php is: And my error is: Error: Database connection failed. It is possible that the database is overloaded or otherwise not running properly. The site administrator should also check that the database details have be…
How do I get the local IP address of the server using PHP?
I am developing a PHP application that will be run only on the local network of a business. The application will be installed to the server using a custom installer like thing we made using Stunnix Advanced Webserver. As part of making the application more user friendly I am planning to display the LOCAL IP o…
How to clear a table in hbase?
I want to empty a table in hbase… eg: user. Is there any command or function to empty the table without deleting it… My table structure is : Can someone help me? Answer There’s no single command to clear Hbase table, but you can use 2 workarounds: disable, delete, create table, or scan all r…